Merge "jquery.suggestions: Hide the suggestions list asynchronously"
[lhc/web/wiklou.git] / includes / content / WikitextContent.php
index 605222e..ccea916 100644 (file)
@@ -154,14 +154,15 @@ class WikitextContent extends TextContent {
         *
         * @param Title $title
         * @param ParserOptions $popts
+        * @param array $params
         *
         * @return Content
         */
-       public function preloadTransform( Title $title, ParserOptions $popts ) {
+       public function preloadTransform( Title $title, ParserOptions $popts, $params = array() ) {
                global $wgParser;
 
                $text = $this->getNativeData();
-               $plt = $wgParser->getPreloadText( $text, $title, $popts );
+               $plt = $wgParser->getPreloadText( $text, $title, $popts, $params );
 
                return new WikitextContent( $plt );
        }
@@ -257,8 +258,6 @@ class WikitextContent extends TextContent {
         *    find out (default: null).
         * @param Title $title Optional title, defaults to the title from the current main request.
         *
-        * @internal param \IContextSource $context context for parsing if necessary
-        *
         * @return bool
         */
        public function isCountable( $hasLinks = null, Title $title = null ) {
@@ -312,41 +311,33 @@ class WikitextContent extends TextContent {
         * Returns a ParserOutput object resulting from parsing the content's text
         * using $wgParser.
         *
-        * @since 1.21
-        *
-        * @param Title $title * @param int $revId Revision to pass to the parser (default: null)
+        * @param Title $title
+        * @param int $revId Revision to pass to the parser (default: null)
         * @param ParserOptions $options (default: null)
-        * @param bool $generateHtml (default: false)
-        * @internal param \IContextSource|null $context
-        *
-        * @return ParserOutput Representing the HTML form of the text
+        * @param bool $generateHtml (default: true)
+        * @param &$output ParserOutput representing the HTML form of the text,
+        *           may be manipulated or replaced.
         */
-       public function getParserOutput( Title $title, $revId = null,
-               ParserOptions $options = null, $generateHtml = true ) {
+       protected function fillParserOutput( Title $title, $revId,
+                       ParserOptions $options, $generateHtml, ParserOutput &$output
+       ) {
                global $wgParser;
 
-               if ( !$options ) {
-                       //NOTE: use canonical options per default to produce cacheable output
-                       $options = $this->getContentHandler()->makeParserOptions( 'canonical' );
-               }
-
                list( $redir, $text ) = $this->getRedirectTargetAndText();
-               $po = $wgParser->parse( $text, $title, $options, true, true, $revId );
+               $output = $wgParser->parse( $text, $title, $options, true, true, $revId );
 
                // Add redirect indicator at the top
                if ( $redir ) {
                        // Make sure to include the redirect link in pagelinks
-                       $po->addLink( $redir );
+                       $output->addLink( $redir );
                        if ( $generateHtml ) {
                                $chain = $this->getRedirectChain();
-                               $po->setText(
+                               $output->setText(
                                        Article::getRedirectHeaderHtml( $title->getPageLanguage(), $chain, false ) .
-                                       $po->getText()
+                                       $output->getText()
                                );
                        }
                }
-
-               return $po;
        }
 
        /**