From: Alexander Ebert Date: Tue, 23 Aug 2016 17:05:17 +0000 (+0200) Subject: Fixed simplified-html adding too many
X-Git-Tag: 3.0.0_Beta_1~556 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=419b3261b90210026d17735e0ef9f0e70d73e166;p=GitHub%2FWoltLab%2FWCF.git Fixed simplified-html adding too many
--- diff --git a/wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeProcessor.class.php b/wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeProcessor.class.php index b24c0de42a..8f9dc49abe 100644 --- a/wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeProcessor.class.php +++ b/wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeProcessor.class.php @@ -91,6 +91,19 @@ class HtmlOutputNodeProcessor extends AbstractHtmlNodeProcessor { } if (!$isLastNode) { + // check if paragraph only contains
+ if (StringUtil::trim($paragraph->textContent) === '') { + // get last element + $element = $paragraph->firstChild; + while ($element && $element->nodeType !== XML_ELEMENT_NODE) { + $element = $element->nextSibling; + } + + if ($element && $element->nodeName === 'br') { + $paragraph->removeChild($element); + } + } + for ($i = 0; $i < 2; $i++) { $br = $this->getDocument()->createElement('br'); $paragraph->appendChild($br);