/** * Recursively call the parser with a new Codes object * This allows to parse BBC in parameters like [quote author="[url]www.quotes.com[/url]"]Something famous.[/quote] * * @param string &$data * @param array $tag */ protected function recursiveParser(&$data, array $tag) { // @todo if parsed tags allowed is empty, return? $bbc = clone $this->bbc; if (!empty($tag[Codes::ATTR_PARSED_TAGS_ALLOWED])) { $bbc->setParsedTags($tag[Codes::ATTR_PARSED_TAGS_ALLOWED]); } // Do not use $this->autolinker. For some reason it causes a recursive loop // @todo figure out why it causes a recursive loop! $autolinker = null; $html = null; $this->triggerEvent('recursive_bbc', array(&$autolinker, &$html)); $parser = new \BBC\Parser($bbc, $autolinker, $html); $parser->canParseAutolink($this->autolink_enabled); $parser->canParseHTML($this->html_enabled); $data = $parser->enableSmileys(empty($tag[Codes::ATTR_PARSED_TAGS_ALLOWED]))->parse($data); }