parse() function, simplifying calling of the parser by supplying options from OutputPage
authorTim Starling <tstarling@users.mediawiki.org>
Mon, 29 Nov 2004 11:26:24 +0000 (11:26 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Mon, 29 Nov 2004 11:26:24 +0000 (11:26 +0000)
includes/OutputPage.php

index f9859e6..565d3e8 100644 (file)
@@ -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