From d028cbcd4a97c680dff94a8b436e80a0a3503814 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Mon, 29 Nov 2004 11:26:24 +0000 Subject: [PATCH] parse() function, simplifying calling of the parser by supplying options from OutputPage --- includes/OutputPage.php | 9 +++++++++ 1 file changed, 9 insertions(+) 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 -- 2.20.1