function TransformLinks($text, $markup = 2.0, $basepage = false) { static $trfm; if (empty($trfm)) { $trfm = new LinkTransformer(); } if ($markup < 2.0) { $text = ConvertOldMarkup($text, 'links'); } if ($basepage) { return new CacheableMarkup($trfm->parse($text), $basepage); } return $trfm->parse($text); }
/** * Transform the text of a page, and return a parse tree. */ function TransformTextPre($text, $markup = 2.0, $basepage = false) { if (isa($text, 'WikiDB_PageRevision')) { $rev = $text; $text = $rev->getPackedContent(); $markup = $rev->get('markup'); } // NEW: default markup is new, to increase stability if (!empty($markup) && $markup < 2.0) { $text = ConvertOldMarkup($text); } // Expand leading tabs. $text = expand_tabs($text); //set_time_limit(3); $output = new WikiText($text); return $output; }
function getConvertedPreview() { include_once 'lib/PageType.php'; $this->_content = $this->getContent(); $this->meta['markup'] = 2.0; $this->_content = ConvertOldMarkup($this->_content); return new TransformedText($this->page, $this->_content, $this->meta); }