From: Alexander Ebert Date: Thu, 4 May 2023 15:57:25 +0000 (+0200) Subject: Strip the `data-cke-fillter` attribute in the HTML output X-Git-Tag: 6.0.0_Alpha_1~136^2~15 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=812a3f40e54d98186aea7ac3977920097241bc0a;p=GitHub%2FWoltLab%2FWCF.git Strip the `data-cke-fillter` attribute in the HTML output --- diff --git a/wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeP.class.php b/wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeP.class.php index 8f333815aa..ddc772249a 100644 --- a/wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeP.class.php +++ b/wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeP.class.php @@ -29,7 +29,15 @@ final class HtmlOutputNodeP extends AbstractHtmlOutputNode foreach ($elements as $element) { if ($element->childElementCount === 1 && $element->firstElementChild) { $child = $element->firstElementChild; - if ($child->tagName === 'br' && $child->getAttribute('data-cke-filler') !== 'true') { + if ($child->tagName === 'br') { + if ($child->getAttribute('data-cke-filler') === 'true') { + // This is an internal marker used to identify paragraphs + // that are intentionally left blank. + $child->removeAttribute('data-cke-filler'); + + continue; + } + // This is most likely a legacy paragraph that was inserted // in earlier versions and is not longer required. We need // to verify that there is no other text inside the node