From cba270fd4bed3c54f7bbfb13363e37e175e91c96 Mon Sep 17 00:00:00 2001 From: pamtbaau Date: Fri, 21 May 2021 22:14:13 +0200 Subject: [PATCH] Add processShortcodesRaw() using raw_handlers (#104) --- classes/plugin/ShortcodeManager.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/classes/plugin/ShortcodeManager.php b/classes/plugin/ShortcodeManager.php index 4c1ca1b..75433ef 100644 --- a/classes/plugin/ShortcodeManager.php +++ b/classes/plugin/ShortcodeManager.php @@ -283,16 +283,27 @@ public function processRawContent(PageInterface $page, Data $config) * For example when used by Twig directly * * @param $str + * @param null $handlers * @return string */ - public function processShortcodes($str) + public function processShortcodes($str, $handlers = null) { $parser = $this->getParser($this->config->get('parser')); - $processor = new Processor(new $parser(new CommonSyntax()), $this->handlers); + + if (!$handlers) { + $handlers = $this->handlers; + } + + $processor = new Processor(new $parser(new CommonSyntax()), $handlers); return $processor->process($str); } + public function processShortcodesRaw($str) + { + return $this->processShortcodes($str, $this->raw_handlers); + } + /** * set a state of a particular item with a hash for retrieval later *