Skip to content

Commit

Permalink
Add processShortcodesRaw() using raw_handlers (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
pamtbaau authored May 21, 2021
1 parent ccca190 commit cba270f
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions classes/plugin/ShortcodeManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down

0 comments on commit cba270f

Please sign in to comment.