From: Alexander Ebert Date: Thu, 4 May 2023 13:57:40 +0000 (+0200) Subject: Flag empty paragraphs as editor generated X-Git-Tag: 6.0.0_Alpha_1~136^2~19 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=839f697b66b631ac5ba1a38cb661567976707242;p=GitHub%2FWoltLab%2FWCF.git Flag empty paragraphs as editor generated --- 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);