From: Alexander Ebert Date: Thu, 13 Aug 2020 21:39:37 +0000 (+0200) Subject: Convert `` into `font-size` X-Git-Tag: 5.3.0_Alpha_1~64 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=14de9cfc9376215dbda89b5a9e977790b4d790dd;p=GitHub%2FWoltLab%2FWCF.git Convert `` into `font-size` --- diff --git a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeSmall.class.php b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeSmall.class.php new file mode 100644 index 0000000000..ac127f7ce0 --- /dev/null +++ b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeSmall.class.php @@ -0,0 +1,52 @@ +` elements into their CSS equivalent. + * + * @author Alexander Ebert + * @copyright 2001-2020 WoltLab GmbH + * @license GNU Lesser General Public License + * @package WoltLabSuite\Core\System\Html\Input\Node + * @since 5.3 + */ +class HtmlInputNodeSmall extends AbstractHtmlInputNode { + /** + * @inheritDoc + */ + protected $tagName = 'small'; + + /** + * @inheritDoc + */ + public function isAllowed(AbstractHtmlNodeProcessor $htmlNodeProcessor) { + if (BBCodeHandler::getInstance()->isAvailableBBCode('size')) { + return []; + } + + return ['size']; + } + + /** + * @inheritDoc + */ + public function process(array $elements, AbstractHtmlNodeProcessor $htmlNodeProcessor) { + /** @var \DOMElement $element */ + foreach ($elements as $element) { + if (DOMUtil::isRemoved($element) || !$element->parentNode) { + continue; + } + + $span = $element->ownerDocument->createElement('span'); + $span->setAttribute('style', "font-size: 10pt"); + + $element->parentNode->insertBefore($span, $element); + $span->appendChild($element); + + DOMUtil::removeNode($element, true); + } + } +}