From b9995d55831d85cfdca56aa447d74680c359c4ca Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 7 Jun 2011 17:34:20 +0000 Subject: [PATCH] Provisional revert of r89648: "Another try at fixing bug 93 "tilde signatures inside nowiki tags sometimes get expanded (~~~~)"" This seems to disable PST for ... in addition to the ... 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 | 2 -- includes/parser/Preprocessor_DOM.php | 5 +---- includes/parser/Preprocessor_Hash.php | 5 +---- tests/parser/parserTests.txt | 4 ++-- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index fa7cfbcaf0..4577727668 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -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 - (~~~~) === API changes in 1.19 === * BREAKING CHANGE: action=watch now requires POST and token. diff --git a/includes/parser/Preprocessor_DOM.php b/includes/parser/Preprocessor_DOM.php index 537abe9891..48c234575f 100644 --- a/includes/parser/Preprocessor_DOM.php +++ b/includes/parser/Preprocessor_DOM.php @@ -1089,11 +1089,8 @@ class PPFrame_DOM implements PPFrame { # OT_WIKI will only respect 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 .= ''; } diff --git a/includes/parser/Preprocessor_Hash.php b/includes/parser/Preprocessor_Hash.php index 77fe7c9a63..c2d7d3d8de 100644 --- a/includes/parser/Preprocessor_Hash.php +++ b/includes/parser/Preprocessor_Hash.php @@ -1019,11 +1019,8 @@ class PPFrame_Hash implements PPFrame { # OT_WIKI will only respect 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 .= ''; } diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index f90c523b7d..492d64699b 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -3926,7 +3926,7 @@ pst !! result * [[Special:Contributions/127.0.0.1|127.0.0.1]] * [[Special:Contributions/127.0.0.1|127.0.0.1]] -* ~~~ +* [[Special:Contributions/127.0.0.1|127.0.0.1]] * [[Special:Contributions/127.0.0.1|127.0.0.1]] !! 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: -- 2.20.1