From: Conrad Irwin
Date: Sun, 7 Feb 2010 13:17:05 +0000 (+0000)
Subject: Fixes for r62077
X-Git-Tag: 1.31.0-rc.0~37895
X-Git-Url: http://git.cyclocoop.org//%22%22.url_de_base%28%29.%22/%22?a=commitdiff_plain;h=0443dd4c5c4ef8e85d659fd39288c53e6d906bd7;p=lhc%2Fweb%2Fwiklou.git
Fixes for r62077
{{pipetrick:}} -> {{#pipetrick:}} per IAlex
clearer documentation per Siebrand
parser test for new magic word.
---
diff --git a/includes/parser/CoreParserFunctions.php b/includes/parser/CoreParserFunctions.php
index bca239f8d9..37e8060901 100644
--- a/includes/parser/CoreParserFunctions.php
+++ b/includes/parser/CoreParserFunctions.php
@@ -67,7 +67,7 @@ class CoreParserFunctions {
$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 @@ class CoreParserFunctions {
}
/**
- * 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)
diff --git a/maintenance/parserTests.txt b/maintenance/parserTests.txt
index 9a3d98cefd..264e207c58 100644
--- a/maintenance/parserTests.txt
+++ b/maintenance/parserTests.txt
@@ -2021,6 +2021,21 @@ title=[[User:Ãvar Arnfjörð Bjarmason]]
!! end
+!! test
+Magic Word: {{#PIPETRICK:}}
+!! options
+title=[[Some (page)]]
+!! input
+{{#pipetrick:Hello (one)}}
+{{#pipetrick:World, hi|}}
+{{#pipetrick:|Other}}
+!! result
+Hello
+World
+Other (page)
+
+!! end
+
!! test
Magic Word: {{REVISIONID}}
!! input