From: Alexander Ebert Date: Sat, 1 Aug 2020 17:33:53 +0000 (+0200) Subject: Support for custom block level tag names X-Git-Tag: 5.3.0_Alpha_1~105 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c52ee4bdd95c7b44c930ac5e8a5fc561ee3065e3;p=GitHub%2FWoltLab%2FWCF.git Support for custom block level tag names Closes #3270 --- 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; } /**