[BUGFIX] RTE Remove Format removes too much 23/30223/2
authorStanislas Rolland <typo3@sjbr.ca>
Tue, 20 May 2014 01:08:22 +0000 (21:08 -0400)
committerStanislas Rolland <typo3@sjbr.ca>
Tue, 20 May 2014 01:14:45 +0000 (03:14 +0200)
The remove format function with msword selected removes too much
content when there is more than one style block in content.

Note: Thanks to Volker Burggräf

Resolves: #58310
Releases: 6.2, 6.1, 4.5
Change-Id: Ia29767239d92fde20ceee97ece47786d3fd3a9a5
Reviewed-on: https://review.typo3.org/30223
Reviewed-by: Stanislas Rolland
Tested-by: Stanislas Rolland
typo3/sysext/rtehtmlarea/htmlarea/plugins/RemoveFormat/remove-format.js

index ab54ae4..fad4269 100644 (file)
@@ -241,10 +241,10 @@ HTMLArea.RemoveFormat = Ext.extend(HTMLArea.Plugin, {
                                html = html.replace(/<\/?(img|imagedata)(>|[^>a-zA-Z][^>]*>)/gi, "");
                                        // Remove MS-specific tags
                                html = html.replace(/<\/?(f|formulas|lock|path|shape|shapetype|stroke)(>|[^>a-zA-Z][^>]*>)/gi, "");
-                                       // Remove unwanted tags and their contents: style, title
-                               html = html.replace(/<style[^>]*>.*<\/style[^>]*>/gi, "").
+                               // Remove unwanted tags and their contents: style, title
+                               html = html.replace(/<style[^>]*>.*?<\/style[^>]*>/gi, "").
                                        replace(/<title[^>]*>.*<\/title[^>]*>/gi, "");
-                                       // Remove comments
+                               // Remove comments
                                html = html.replace(/<!--[^>]*>/gi, "");
                                        // Remove xml tags
                                html = html.replace(/<xml.[^>]*>/gi, "");