From 812a3f40e54d98186aea7ac3977920097241bc0a Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 4 May 2023 17:57:25 +0200 Subject: [PATCH] Strip the `data-cke-fillter` attribute in the HTML output --- .../system/html/output/node/HtmlOutputNodeP.class.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 -- 2.20.1