Fixed incorrect behavior for empty lists
authorAlexander Ebert <ebert@woltlab.com>
Thu, 8 Dec 2016 20:08:34 +0000 (21:08 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 8 Dec 2016 20:08:39 +0000 (21:08 +0100)
wcfsetup/install/files/lib/system/html/metacode/converter/ListMetacodeConverter.class.php

index 449a296ed8a9942064305d6c7f141cf478ab1759..eee4f0a6feb7d7319abfe32eade45ee789278b1d 100644 (file)
@@ -132,7 +132,8 @@ class ListMetacodeConverter extends AbstractMetacodeConverter {
                                        }
                                }
                                
-                               if ($isEmpty) {
+                               // discard the <li> unless it is the only one
+                               if ($isEmpty && $childNode->parentNode->firstChild !== $childNode) {
                                        DOMUtil::removeNode($childNode);
                                }
                        }