Provisional revert of r89648: "Another try at fixing bug 93 "tilde signatures inside...
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 7 Jun 2011 17:34:20 +0000 (17:34 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 7 Jun 2011 17:34:20 +0000 (17:34 +0000)
This seems to disable PST for <includeonly>...</includeonly> in addition to the <includeonly><nowiki>...</nowiki></includeonly> that the bug is about.
This was caught by a parser test case, but the test case was changed to match... seems like the wrong change?

Also failed to update Preprocessor_HipHop.hphp to match the other two preprocessor classes.

RELEASE-NOTES-1.19
includes/parser/Preprocessor_DOM.php
includes/parser/Preprocessor_Hash.php
tests/parser/parserTests.txt

index fa7cfbc..4577727 100644 (file)
@@ -86,8 +86,6 @@ production.
 * (bug 29101) Special:FileDuplicateSearch shows silly message
 * (bug 29048) jQuery.tabIndex: firstTabIndex() should not output the same
   as lastTabIndex().
-* (bug 93) tilde signatures inside nowiki tags sometimes get expanded
-  (<includeonly><nowiki>~~~~</nowiki></includeonly>)
 
 === API changes in 1.19 ===
 * BREAKING CHANGE: action=watch now requires POST and token.
index 537abe9..48c2345 100644 (file)
@@ -1089,11 +1089,8 @@ class PPFrame_DOM implements PPFrame {
                                        # OT_WIKI will only respect <ignore> in substed templates.
                                        # The other output types respect it unless NO_IGNORE is set.
                                        # extractSections() sets NO_IGNORE and so never respects it.
-                                       if ( $flags & PPFrame::NO_IGNORE ) {
+                                       if ( ( !isset( $this->parent ) && $this->parser->ot['wiki'] ) || ( $flags & PPFrame::NO_IGNORE ) ) {
                                                $out .= $contextNode->textContent;
-                                       # Add a strip marker in PST mode so that pstPass2() can run some old-fashioned regexes on the result
-                                       } elseif ( !isset( $this->parent ) && $this->parser->ot['wiki'] ) {
-                                               $out .= $this->parser->insertStripItem( $contextNode->textContent );
                                        } else {
                                                $out .= '';
                                        }
index 77fe7c9..c2d7d3d 100644 (file)
@@ -1019,11 +1019,8 @@ class PPFrame_Hash implements PPFrame {
                                        # OT_WIKI will only respect <ignore> in substed templates.
                                        # The other output types respect it unless NO_IGNORE is set.
                                        # extractSections() sets NO_IGNORE and so never respects it.
-                                       if ( $flags & PPFrame::NO_IGNORE ) {
+                                       if ( ( !isset( $this->parent ) && $this->parser->ot['wiki'] ) || ( $flags & PPFrame::NO_IGNORE ) ) {
                                                $out .= $contextNode->firstChild->value;
-                                       # Add a strip marker in PST mode so that pstPass2() can run some old-fashioned regexes on the result
-                                       } elseif ( !isset( $this->parent ) && $this->parser->ot['wiki'] ) {
-                                               $out .= $this->parser->insertStripItem( $contextNode->firstChild->value );
                                        } else {
                                                //$out .= '';
                                        }
index f90c523..492d646 100644 (file)
@@ -3926,7 +3926,7 @@ pst
 !! result
 * [[Special:Contributions/127.0.0.1|127.0.0.1]]
 * <noinclude>[[Special:Contributions/127.0.0.1|127.0.0.1]]</noinclude>
-* <includeonly>~~~</includeonly>
+* <includeonly>[[Special:Contributions/127.0.0.1|127.0.0.1]]</includeonly>
 * <onlyinclude>[[Special:Contributions/127.0.0.1|127.0.0.1]]</onlyinclude>
 !! end
 
@@ -3934,7 +3934,7 @@ pst
 !! test
 pre-save transform: Signature expansion in nowiki tags (bug 93)
 !! options
-pst
+pst disabled
 !! input
 Shall not expand: