http://www.mediawiki.org/wiki/Special:Code/MediaWiki/62081
Revision: 62081 Author: conrad Date: 2010-02-07 13:17:05 +0000 (Sun, 07 Feb 2010) Log Message: ----------- 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 trunk/phase3/maintenance/parserTests.txt Modified: trunk/phase3/includes/parser/CoreParserFunctions.php =================================================================== --- trunk/phase3/includes/parser/CoreParserFunctions.php 2010-02-07 11:59:58 UTC (rev 62080) +++ trunk/phase3/includes/parser/CoreParserFunctions.php 2010-02-07 13:17:05 UTC (rev 62081) @@ -67,7 +67,7 @@ $parser->setFunctionHook( 'talkpagenamee', array( __CLASS__, 'talkpagenamee' ), SFH_NO_HASH ); $parser->setFunctionHook( 'subjectpagename', array( __CLASS__, 'subjectpagename' ), SFH_NO_HASH ); $parser->setFunctionHook( 'subjectpagenamee', array( __CLASS__, 'subjectpagenamee' ), SFH_NO_HASH ); - $parser->setFunctionHook( 'pipetrick', array( __CLASS__, 'pipetrick' ), SFH_NO_HASH ); + $parser->setFunctionHook( 'pipetrick', array( __CLASS__, 'pipetrick' ) ); $parser->setFunctionHook( 'tag', array( __CLASS__, 'tagObj' ), SFH_OBJECT_ARGS ); $parser->setFunctionHook( 'formatdate', array( __CLASS__, 'formatDate' ) ); @@ -441,8 +441,11 @@ } /** - * Performs the pipe trick. Can be used in three ways: - * {{pipetrick:title}} == {{pipetrick:title|}} != {{pipetrick:|title}} + * Performs the pipe trick in the same manner as [[title|]] or [[|title]]. + * {{#pipetrick:title}} == {{#pipetrick:title|}} -> Parser::getPipeTrickText + * {{#pipetrick:|title}} -> Parser::getPipeTrickLink (rarer) + * See http://en.wikipedia.org/wiki/Help:Pipe_trick and the Parser documentation + * for more information. */ static function pipetrick( $parser, $link = '', $text = '' ) { if ($link) Modified: trunk/phase3/maintenance/parserTests.txt =================================================================== --- trunk/phase3/maintenance/parserTests.txt 2010-02-07 11:59:58 UTC (rev 62080) +++ trunk/phase3/maintenance/parserTests.txt 2010-02-07 13:17:05 UTC (rev 62081) @@ -2022,6 +2022,21 @@ !! end !! test +Magic Word: {{#PIPETRICK:}} +!! options +title=[[Some (page)]] +!! input +{{#pipetrick:Hello (one)}} +{{#pipetrick:World, hi|}} +{{#pipetrick:|Other}} +!! result +<p>Hello +World +Other (page) +</p> +!! end + +!! test Magic Word: {{REVISIONID}} !! input {{REVISIONID}} _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs