Index: trunk/phase3/maintenance/parserTests.txt |
— | — | @@ -2022,6 +2022,21 @@ |
2023 | 2023 | !! end |
2024 | 2024 | |
2025 | 2025 | !! 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 |
2026 | 2041 | Magic Word: {{REVISIONID}} |
2027 | 2042 | !! input |
2028 | 2043 | {{REVISIONID}} |
Index: trunk/phase3/includes/parser/CoreParserFunctions.php |
— | — | @@ -67,7 +67,7 @@ |
68 | 68 | $parser->setFunctionHook( 'talkpagenamee', array( __CLASS__, 'talkpagenamee' ), SFH_NO_HASH ); |
69 | 69 | $parser->setFunctionHook( 'subjectpagename', array( __CLASS__, 'subjectpagename' ), SFH_NO_HASH ); |
70 | 70 | $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' ) ); |
72 | 72 | $parser->setFunctionHook( 'tag', array( __CLASS__, 'tagObj' ), SFH_OBJECT_ARGS ); |
73 | 73 | $parser->setFunctionHook( 'formatdate', array( __CLASS__, 'formatDate' ) ); |
74 | 74 | |
— | — | @@ -441,8 +441,11 @@ |
442 | 442 | } |
443 | 443 | |
444 | 444 | /** |
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. |
447 | 450 | */ |
448 | 451 | static function pipetrick( $parser, $link = '', $text = '' ) { |
449 | 452 | if ($link) |