r62081 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62080‎ | r62081 | r62082 >
Date:13:17, 7 February 2010
Author:conrad
Status:reverted
Tags:
Comment:
Fixes for r62077

{{pipetrick:}} -> {{#pipetrick:}} per IAlex
clearer documentation per Siebrand
parser test for new magic word.
Modified paths:
  • /trunk/phase3/includes/parser/CoreParserFunctions.php (modified) (history)
  • /trunk/phase3/maintenance/parserTests.txt (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/parserTests.txt
@@ -2022,6 +2022,21 @@
20232023 !! end
20242024
20252025 !! test
 2026+Magic Word: {{#PIPETRICK:}}
 2027+!! options
 2028+title=[[Some (page)]]
 2029+!! input
 2030+{{#pipetrick:Hello (one)}}
 2031+{{#pipetrick:World, hi|}}
 2032+{{#pipetrick:|Other}}
 2033+!! result
 2034+<p>Hello
 2035+World
 2036+Other (page)
 2037+</p>
 2038+!! end
 2039+
 2040+!! test
20262041 Magic Word: {{REVISIONID}}
20272042 !! input
20282043 {{REVISIONID}}
Index: trunk/phase3/includes/parser/CoreParserFunctions.php
@@ -67,7 +67,7 @@
6868 $parser->setFunctionHook( 'talkpagenamee', array( __CLASS__, 'talkpagenamee' ), SFH_NO_HASH );
6969 $parser->setFunctionHook( 'subjectpagename', array( __CLASS__, 'subjectpagename' ), SFH_NO_HASH );
7070 $parser->setFunctionHook( 'subjectpagenamee', array( __CLASS__, 'subjectpagenamee' ), SFH_NO_HASH );
71 - $parser->setFunctionHook( 'pipetrick', array( __CLASS__, 'pipetrick' ), SFH_NO_HASH );
 71+ $parser->setFunctionHook( 'pipetrick', array( __CLASS__, 'pipetrick' ) );
7272 $parser->setFunctionHook( 'tag', array( __CLASS__, 'tagObj' ), SFH_OBJECT_ARGS );
7373 $parser->setFunctionHook( 'formatdate', array( __CLASS__, 'formatDate' ) );
7474
@@ -441,8 +441,11 @@
442442 }
443443
444444 /**
445 - * Performs the pipe trick. Can be used in three ways:
446 - * {{pipetrick:title}} == {{pipetrick:title|}} != {{pipetrick:|title}}
 445+ * Performs the pipe trick in the same manner as [[title|]] or [[|title]].
 446+ * {{#pipetrick:title}} == {{#pipetrick:title|}} -> Parser::getPipeTrickText
 447+ * {{#pipetrick:|title}} -> Parser::getPipeTrickLink (rarer)
 448+ * See http://en.wikipedia.org/wiki/Help:Pipe_trick and the Parser documentation
 449+ * for more information.
447450 */
448451 static function pipetrick( $parser, $link = '', $text = '' ) {
449452 if ($link)

Follow-up revisions

RevisionCommit summaryAuthorDate
r62111partial revert for r62081. Make {{PIPETRICK}} like {{PAGENAME}}, add {{PIPETR...conrad02:07, 8 February 2010
r62689Moving Conrad's recent parser work out to a branch. Reverted r62434, r62416, ...tstarling05:19, 19 February 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r62077Bug 7264 - Magic word to give Page Title as if pipe-trick performed on it {{...conrad02:36, 7 February 2010

Status & tagging log