Merge "Introduce ParserOutput::getRawText()"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 25 Jan 2016 12:03:10 +0000 (12:03 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 25 Jan 2016 12:03:10 +0000 (12:03 +0000)
includes/content/WikitextContent.php
includes/parser/ParserOutput.php

index 8beae39..89e9356 100644 (file)
@@ -338,7 +338,7 @@ class WikitextContent extends TextContent {
                                $chain = $this->getRedirectChain();
                                $output->setText(
                                        Article::getRedirectHeaderHtml( $title->getPageLanguage(), $chain, false ) .
-                                       $output->getText()
+                                       $output->getRawText()
                                );
                                $output->addModuleStyles( 'mediawiki.action.view.redirectPage' );
                        }
index 72668bf..656e580 100644 (file)
@@ -220,6 +220,17 @@ class ParserOutput extends CacheTime {
                $this->mTitleText = $titletext;
        }
 
+       /**
+        * Get the cacheable text with <mw:editsection> markers still in it. The
+        * return value is suitable for writing back via setText() but is not valid
+        * for display to the user.
+        *
+        * @since 1.27
+        */
+       public function getRawText() {
+               return $this->mText;
+       }
+
        public function getText() {
                $text = $this->mText;
                if ( $this->mEditSectionTokens ) {