From: Tim Starling Date: Mon, 29 Nov 2004 11:26:24 +0000 (+0000) Subject: parse() function, simplifying calling of the parser by supplying options from OutputPage X-Git-Tag: 1.5.0alpha1~1195 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=d028cbcd4a97c680dff94a8b436e80a0a3503814;p=lhc%2Fweb%2Fwiklou.git parse() function, simplifying calling of the parser by supplying options from OutputPage --- diff --git a/includes/OutputPage.php b/includes/OutputPage.php index f9859e6f9e..565d3e816d 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -269,6 +269,15 @@ class OutputPage { $this->addHtml( ob_get_contents() ); ob_end_clean(); } + + /** + * Parse wikitext and return the HTML. This is for special pages that add the text later + */ + function parse( $text, $linestart = true ) { + global $wgParser, $wgTitle; + $parserOutput = $wgParser->parse( $text, $wgTitle, $this->mParserOptions, $linestart ); + return $parserOutput->getText(); + } /** * @param $article