From c52ee4bdd95c7b44c930ac5e8a5fc561ee3065e3 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sat, 1 Aug 2020 19:33:53 +0200 Subject: [PATCH] Support for custom block level tag names Closes #3270 --- ...HtmlInputNodeWoltlabMetacodeMarker.class.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMetacodeMarker.class.php b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMetacodeMarker.class.php index 39b0fbf456..b62c854dbf 100644 --- a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMetacodeMarker.class.php +++ b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMetacodeMarker.class.php @@ -17,6 +17,12 @@ use wcf\util\DOMUtil; * @since 3.0 */ class HtmlInputNodeWoltlabMetacodeMarker extends AbstractHtmlInputNode { + /** + * list of tag names that should be considered as block level elements + * @var string[] + */ + public static $customBlockElementTagNames = []; + /** * list of bbcodes that represent block elements * @var string[] @@ -508,17 +514,14 @@ class HtmlInputNodeWoltlabMetacodeMarker extends AbstractHtmlInputNode { case 'woltlab-quote': case 'woltlab-spoiler': return true; - break; case 'woltlab-metacode': /** @var \DOMElement $node */ - if (in_array($node->getAttribute('data-name'), $this->blockElements)) { - return true; - } - break; + return in_array($node->getAttribute('data-name'), $this->blockElements) + + default: + return in_array($node->nodeName, self::$customBlockElementTagNames) } - - return false; } /** -- 2.20.1