Improved list bbcode conversion
authorAlexander Ebert <ebert@woltlab.com>
Fri, 25 Nov 2016 14:57:20 +0000 (15:57 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 25 Nov 2016 14:57:20 +0000 (15:57 +0100)
wcfsetup/install/files/lib/system/html/metacode/converter/ListMetacodeConverter.class.php

index 832b2140d72178c68fc807e12d73e11bfa8011c8..449a296ed8a9942064305d6c7f141cf478ab1759 100644 (file)
@@ -163,6 +163,11 @@ class ListMetacodeConverter extends AbstractMetacodeConverter {
                                        DOMUtil::removeNode($removeNode);
                                }
                        }
+                       
+                       // remove the first list item if it is completely empty
+                       if ($element->firstChild->childNodes->length === 0 && $element->firstChild !== $element->lastChild) {
+                               DOMUtil::removeNode($element->firstChild);
+                       }
                }
                
                return $element;