From 728f8c7d123a34f1126ea9e0436683f2de7edadf Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 16 Nov 2016 15:30:50 +0100 Subject: [PATCH] Strip dummy paragraphs --- .../html/input/node/HtmlInputNodeProcessor.class.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeProcessor.class.php b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeProcessor.class.php index 55d4880fc0..34bb064d41 100644 --- a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeProcessor.class.php +++ b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeProcessor.class.php @@ -239,6 +239,14 @@ class HtmlInputNodeProcessor extends AbstractHtmlNodeProcessor { } } + // strip empty

(zero content, not even whitespaces) + $paragraphs = DOMUtil::getElements($this->getDocument(), 'p'); + foreach ($paragraphs as $paragraph) { + if ($paragraph->childNodes->length === 0) { + DOMUtil::removeNode($paragraph); + } + } + // trim

...

/** @var \DOMElement $paragraph */ foreach ($this->getDocument()->getElementsByTagName('p') as $paragraph) { -- 2.20.1