r89662 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89661‎ | r89662 | r89663 >
Date:17:34, 7 June 2011
Author:brion
Status:ok
Tags:
Comment:
Provisional revert of r89648: "Another try at fixing bug 93 "tilde signatures inside nowiki tags sometimes get expanded (<includeonly><nowiki>~~~~</nowiki></includeonly>)""

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.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /trunk/phase3/includes/parser/Preprocessor_DOM.php (modified) (history)
  • /trunk/phase3/includes/parser/Preprocessor_Hash.php (modified) (history)
  • /trunk/phase3/tests/parser/parserTests.txt (modified) (history)

Diff [purge]

Index: trunk/phase3/RELEASE-NOTES-1.19
@@ -86,8 +86,6 @@
8787 * (bug 29101) Special:FileDuplicateSearch shows silly message
8888 * (bug 29048) jQuery.tabIndex: firstTabIndex() should not output the same
8989 as lastTabIndex().
90 -* (bug 93) tilde signatures inside nowiki tags sometimes get expanded
91 - (<includeonly><nowiki>~~~~</nowiki></includeonly>)
9290
9391 === API changes in 1.19 ===
9492 * BREAKING CHANGE: action=watch now requires POST and token.
Index: trunk/phase3/tests/parser/parserTests.txt
@@ -3926,7 +3926,7 @@
39273927 !! result
39283928 * [[Special:Contributions/127.0.0.1|127.0.0.1]]
39293929 * <noinclude>[[Special:Contributions/127.0.0.1|127.0.0.1]]</noinclude>
3930 -* <includeonly>~~~</includeonly>
 3930+* <includeonly>[[Special:Contributions/127.0.0.1|127.0.0.1]]</includeonly>
39313931 * <onlyinclude>[[Special:Contributions/127.0.0.1|127.0.0.1]]</onlyinclude>
39323932 !! end
39333933
@@ -3934,7 +3934,7 @@
39353935 !! test
39363936 pre-save transform: Signature expansion in nowiki tags (bug 93)
39373937 !! options
3938 -pst
 3938+pst disabled
39393939 !! input
39403940 Shall not expand:
39413941
Index: trunk/phase3/includes/parser/Preprocessor_Hash.php
@@ -1019,11 +1019,8 @@
10201020 # OT_WIKI will only respect <ignore> in substed templates.
10211021 # The other output types respect it unless NO_IGNORE is set.
10221022 # extractSections() sets NO_IGNORE and so never respects it.
1023 - if ( $flags & PPFrame::NO_IGNORE ) {
 1023+ if ( ( !isset( $this->parent ) && $this->parser->ot['wiki'] ) || ( $flags & PPFrame::NO_IGNORE ) ) {
10241024 $out .= $contextNode->firstChild->value;
1025 - # Add a strip marker in PST mode so that pstPass2() can run some old-fashioned regexes on the result
1026 - } elseif ( !isset( $this->parent ) && $this->parser->ot['wiki'] ) {
1027 - $out .= $this->parser->insertStripItem( $contextNode->firstChild->value );
10281025 } else {
10291026 //$out .= '';
10301027 }
Index: trunk/phase3/includes/parser/Preprocessor_DOM.php
@@ -1089,11 +1089,8 @@
10901090 # OT_WIKI will only respect <ignore> in substed templates.
10911091 # The other output types respect it unless NO_IGNORE is set.
10921092 # extractSections() sets NO_IGNORE and so never respects it.
1093 - if ( $flags & PPFrame::NO_IGNORE ) {
 1093+ if ( ( !isset( $this->parent ) && $this->parser->ot['wiki'] ) || ( $flags & PPFrame::NO_IGNORE ) ) {
10941094 $out .= $contextNode->textContent;
1095 - # Add a strip marker in PST mode so that pstPass2() can run some old-fashioned regexes on the result
1096 - } elseif ( !isset( $this->parent ) && $this->parser->ot['wiki'] ) {
1097 - $out .= $this->parser->insertStripItem( $contextNode->textContent );
10981095 } else {
10991096 $out .= '';
11001097 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r5295BUG#93 Fix handling of <nowiki> in templatesjeluf23:14, 18 September 2004
r5296BUG#93 Fix handling of <nowiki> in templates. From HEADjeluf23:17, 18 September 2004
r13917(bug 93) <nowiki> tags and tildes in templatesrobchurch02:20, 29 April 2006
r88997fix for Bug #93 “tilde signatures inside nowiki tags sometimes get expanded...mah20:55, 27 May 2011
r89308Revert r88997: fix for bug 93 caused some additional problems....brion00:32, 2 June 2011
r89648Another try at fixing bug 93 "tilde signatures inside nowiki tags sometimes g...pcopp15:12, 7 June 2011

Status & tagging log