コード例 #1
0
 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;
 }
コード例 #2
0
 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;
 }
コード例 #3
0
ファイル: common.inc.php プロジェクト: oparoz/thebuggenie
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;
}
コード例 #4
0
ファイル: TBGIssue.class.php プロジェクト: oparoz/thebuggenie
 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;
 }