From 1d8dd3a733bb4c099d9a12f7415af8faa9f0125f Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sun, 15 May 2016 00:07:28 +0200 Subject: [PATCH] Some cleanup --- .../node/HtmlInputNodeWoltlabMetacode.class.php | 11 ----------- .../html/output/HtmlOutputProcessor.class.php | 17 +++++++++++------ .../HtmlOutputNodeProcessor.class.php | 4 +--- 3 files changed, 12 insertions(+), 20 deletions(-) rename wcfsetup/install/files/lib/system/html/output/{ => node}/HtmlOutputNodeProcessor.class.php (69%) diff --git a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMetacode.class.php b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMetacode.class.php index 412d814f12..bdc000f0b6 100644 --- a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMetacode.class.php +++ b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMetacode.class.php @@ -81,17 +81,6 @@ class HtmlInputNodeWoltlabMetacode extends AbstractHtmlNode { // attributes are invalid, remove element from DOM DOMUtil::removeNode($element, true); } - - - continue; - $parsedTag = HtmlBBCodeParser::getInstance()->getHtmlOutput($name, $attributes); - - $nodeIdentifier = StringUtil::getRandomID(); - $htmlNodeProcessor->addNodeData($this, $nodeIdentifier, [ - 'parsedTag' => $parsedTag - ]); - - $htmlNodeProcessor->renameTag($metacode, 'wcfNode-' . $nodeIdentifier); } } diff --git a/wcfsetup/install/files/lib/system/html/output/HtmlOutputProcessor.class.php b/wcfsetup/install/files/lib/system/html/output/HtmlOutputProcessor.class.php index c9774151d3..d9f12d0733 100644 --- a/wcfsetup/install/files/lib/system/html/output/HtmlOutputProcessor.class.php +++ b/wcfsetup/install/files/lib/system/html/output/HtmlOutputProcessor.class.php @@ -1,5 +1,6 @@ htmlOutputNodeProcessor = $htmlOutputNodeProcessor; + public function process($html) { + $this->getHtmlOutputNodeProcessor()->load($html); + $this->getHtmlOutputNodeProcessor()->process(); + + return $this->getHtmlOutputNodeProcessor()->getHtml(); } - public function process($html) { - $this->htmlOutputNodeProcessor->load($html); - $this->htmlOutputNodeProcessor->process(); + protected function getHtmlOutputNodeProcessor() { + if ($this->htmlOutputNodeProcessor === null) { + $this->htmlOutputNodeProcessor = new HtmlOutputNodeProcessor(); + } - return $this->htmlOutputNodeProcessor->getHtml(); + return $this->htmlOutputNodeProcessor; } } diff --git a/wcfsetup/install/files/lib/system/html/output/HtmlOutputNodeProcessor.class.php b/wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeProcessor.class.php similarity index 69% rename from wcfsetup/install/files/lib/system/html/output/HtmlOutputNodeProcessor.class.php rename to wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeProcessor.class.php index 91b7139e9d..65794ba25e 100644 --- a/wcfsetup/install/files/lib/system/html/output/HtmlOutputNodeProcessor.class.php +++ b/wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeProcessor.class.php @@ -1,8 +1,6 @@