From 839f697b66b631ac5ba1a38cb661567976707242 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 4 May 2023 15:57:40 +0200 Subject: [PATCH] Flag empty paragraphs as editor generated --- .../system/html/input/filter/MessageHtmlInputFilter.class.php | 3 +++ .../system/html/input/node/HtmlInputNodeProcessor.class.php | 1 + 2 files changed, 4 insertions(+) diff --git a/wcfsetup/install/files/lib/system/html/input/filter/MessageHtmlInputFilter.class.php b/wcfsetup/install/files/lib/system/html/input/filter/MessageHtmlInputFilter.class.php index 5f16d41bc6..4c69a26999 100644 --- a/wcfsetup/install/files/lib/system/html/input/filter/MessageHtmlInputFilter.class.php +++ b/wcfsetup/install/files/lib/system/html/input/filter/MessageHtmlInputFilter.class.php @@ -82,6 +82,9 @@ class MessageHtmlInputFilter implements IHtmlInputFilter { $definition = $config->getHTMLDefinition(true); + //
+ $definition->addAttribute('br', 'data-cke-filler', new \HTMLPurifier_AttrDef_Enum(['true'])); + // code $definition->addAttribute('pre', 'data-file', 'Text'); $definition->addAttribute('pre', 'data-line', 'Number'); 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 e7601bccf9..0e9c6a9d02 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 @@ -452,6 +452,7 @@ class HtmlInputNodeProcessor extends AbstractHtmlNodeProcessor $node = $paragraph->childNodes->item(0); if ($node->nodeType === \XML_TEXT_NODE && $node->textContent === "\u{00a0}") { $br = $node->ownerDocument->createElement("br"); + $br->setAttribute("data-cke-filler", "true"); $node->parentNode->appendChild($br); $node->parentNode->removeChild($node); -- 2.20.1