[BUGFIX] RTE: WebKit may insert line-height style attribute on paste 49/36749/2
authorStanislas Rolland <typo3@sjbr.ca>
Sun, 8 Feb 2015 17:58:36 +0000 (12:58 -0500)
committerStanislas Rolland <typo3@sjbr.ca>
Sun, 8 Feb 2015 18:17:16 +0000 (19:17 +0100)
Problem: When pasting content that contains (un)ordered lists, WebKit
browsers may insert line-height style attributes on the ul/ol elements.
Solution: Remove the added attributes if enableWordClean is set.

Releases: master, 6.2
Resolves: #63982
Change-Id: I64fe918aa1f0edcc52466736e390ae60b09e7ef8
Reviewed-on: http://review.typo3.org/36749
Reviewed-by: Stanislas Rolland <typo3@sjbr.ca>
Tested-by: Stanislas Rolland <typo3@sjbr.ca>
typo3/sysext/rtehtmlarea/Resources/Public/JavaScript/HTMLArea/DOM/Node.js

index 766f5be..78401c2 100644 (file)
@@ -190,6 +190,18 @@ define('TYPO3/CMS/Rtehtmlarea/HTMLArea/DOM/Node',
                                        this.removeMarkup(fonts[i]);
                                }
                        }
+                       var uls = node.getElementsByTagName('ul');
+                       for (i = uls.length; --i >= 0;) {
+                               if (uls[i].style.cssText.indexOf('line-height') !== -1) {
+                                       uls[i].style.lineHeight = '';
+                               }
+                       }
+                       var ols = node.getElementsByTagName('ol');
+                       for (i = ols.length; --i >= 0;) {
+                               if (ols[i].style.cssText.indexOf('line-height') !== -1) {
+                                       ols[i].style.lineHeight = '';
+                               }
+                       }
                }
        };