[BUGFIX] RTE: WebKit may insert line-height style attribute on paste 50/36750/2
authorStanislas Rolland <typo3@sjbr.ca>
Sun, 8 Feb 2015 18:39:10 +0000 (13:39 -0500)
committerStanislas Rolland <typo3@sjbr.ca>
Sun, 8 Feb 2015 19:38:59 +0000 (20:38 +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/36750
Reviewed-by: Stanislas Rolland <typo3@sjbr.ca>
Tested-by: Stanislas Rolland <typo3@sjbr.ca>
typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js

index adf630a..0d2dea6 100644 (file)
@@ -5135,6 +5135,18 @@ HTMLArea.DOM.Node = Ext.extend(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 = '';
+                               }
+                       }
                }
        }
 });