Fixed a few issues
authorAlexander Ebert <ebert@woltlab.com>
Tue, 3 Mar 2015 12:27:16 +0000 (13:27 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 3 Mar 2015 12:27:16 +0000 (13:27 +0100)
wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js

index 8a29c9b160f26c7ffaa83ee4d49cabd078d8acf5..2824465d8883e64b15af20e47d862eac759db1b9 100644 (file)
@@ -1008,18 +1008,16 @@ RedactorPlugins.wutil = function() {
                                        continue;
                                }
                                
-                               if ($child.children.length > 1 || $child.children[0].tagName === 'BR') {
+                               if ($child.children.length > 1 || ($child.children.length === 1 && $child.children[0].tagName === 'BR')) {
                                        // element contains more than one children or it is just a <br>
                                        continue;
                                }
                                
                                // head all the way down to the most inner node
-                               $child = $child.children[0];
                                while ($child.children.length === 1) {
                                        $child = $child.children[0];
                                }
                                
-                               
                                if ($child.childNodes.length === 0 && $child.tagName !== 'BR') {
                                        var $node = document.createTextNode('\u200b');
                                        $child.appendChild($node);