public function __invoke(Filter $node, Compiler $compiler) { $parser = new Parser(); return $parser->parse($this->getNodeString($node, $compiler)); }
protected function parseInline($text) { $elements = parent::parseInline($text); // merge special attribute elements to links and images as they are not part of the final absy later $relatedElement = null; foreach ($elements as $i => $element) { if ($element[0] === 'link' || $element[0] === 'image' || $element[0] === 'iframe') { $relatedElement = $i; } elseif ($element[0] === 'specialAttributes') { if ($relatedElement !== null) { $elements[$relatedElement]['attributes'] = $element[1]; unset($elements[$i]); } $relatedElement = null; } else { $relatedElement = null; } } return $elements; }
public function parse($string, $path = null) { return $this->parser->parse($string); }