function tbg_parse_text($text, $toc = false, $article_id = null, $options = array()) { // Perform wiki parsing $wiki_parser = new TBGTextParser($text, $toc, 'article_' . $article_id); foreach ($options as $option => $value) { $wiki_parser->setOption($option, $value); } $text = $wiki_parser->getParsedText(); return $text; }
public function getParsedContent($options = array()) { switch ($this->_content_syntax) { case TBGSettings::SYNTAX_PT: $options = array('plain' => true); case TBGSettings::SYNTAX_MW: $wiki_parser = new TBGTextParser($this->_content, true, $this->getID()); foreach ($options as $option => $value) { $wiki_parser->setOption($option, $value); } $text = $wiki_parser->getParsedText(); break; case TBGSettings::SYNTAX_MD: $parser = new TBGTextParserMarkdown(); $text = $parser->transform($this->_content); break; } return $text; }
protected function _parseContent($options = array()) { switch ($this->_syntax) { case TBGSettings::SYNTAX_PT: $options = array('plain' => true); case TBGSettings::SYNTAX_MW: $parser = new TBGTextParser($this->_content); foreach ($options as $option => $value) { $parser->setOption($option, $value); } $text = $parser->getParsedText(); break; case TBGSettings::SYNTAX_MD: $parser = new TBGTextParserMarkdown(); $text = $parser->transform($this->_content); break; } if (isset($parser)) { $this->_parser = $parser; } return $text; }
function tbg_parse_text($text, $toc = false, $article_id = null, $options = array(), $syntax = TBGSettings::SYNTAX_MW) { switch ($syntax) { case TBGSettings::SYNTAX_PT: $options = array('plain' => true); case TBGSettings::SYNTAX_MW: $wiki_parser = new TBGTextParser($text, $toc, 'article_' . $article_id); foreach ($options as $option => $value) { $wiki_parser->setOption($option, $value); } $text = $wiki_parser->getParsedText(); break; case TBGSettings::SYNTAX_MD: $parser = new TBGTextParserMarkdown(); $text = $parser->transform($text); break; } return $text; }
protected function _getParsedText($text, $syntax, $options = array()) { switch ($syntax) { case TBGSettings::SYNTAX_PT: $options = array('plain' => true); case TBGSettings::SYNTAX_MW: $wiki_parser = new TBGTextParser($text); foreach ($options as $option => $value) { $wiki_parser->setOption($option, $value); } $text = $wiki_parser->getParsedText(); break; case TBGSettings::SYNTAX_MD: $parser = new TBGTextParserMarkdown(); $text = $parser->transform($text); break; } return $text; }