jenkins-bot has submitted this change and it was merged.
Change subject: Support {{!}} as a magic word
......................................................................
Support {{!}} as a magic word
Add {{!}} as a magic word that expands to a pipe. Parsoid already does
this, so we know it isn't going to cause major breakage.
Change-Id: I1f857417d224d6443504074a5add852df3975b89
---
M RELEASE-NOTES-1.24
M includes/MagicWord.php
M includes/parser/Parser.php
M languages/messages/MessagesEn.php
M tests/parser/parserTests.txt
5 files changed, 7 insertions(+), 6 deletions(-)
Approvals:
Jforrester: Looks good to me, approved
jenkins-bot: Verified
diff --git a/RELEASE-NOTES-1.24 b/RELEASE-NOTES-1.24
index d8543b7..c43e730 100644
--- a/RELEASE-NOTES-1.24
+++ b/RELEASE-NOTES-1.24
@@ -92,6 +92,8 @@
* Browser tests are now included to verify basic wiki functionality in
developer
environments. For details on running tests, see
tests/browser/README.mediawiki.
* Upgrade jStorage to v0.4.10.
+* {{!}} is now a magic word that produces the | character. This removes the
need
+ for Template:! for purposes such as passing pipes inside of parameters.
=== Bug fixes in 1.24 ===
* (bug 49116) Footer copyright notice is now always displayed in user language
diff --git a/includes/MagicWord.php b/includes/MagicWord.php
index 3e327c3..7decbee 100644
--- a/includes/MagicWord.php
+++ b/includes/MagicWord.php
@@ -96,6 +96,7 @@
static public $mVariableIDsInitialised = false;
static public $mVariableIDs = array(
+ '!',
'currentmonth',
'currentmonth1',
'currentmonthname',
diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php
index fa5d678..eb7bd1b 100644
--- a/includes/parser/Parser.php
+++ b/includes/parser/Parser.php
@@ -2820,6 +2820,9 @@
$pageLang = $this->getFunctionLang();
switch ( $index ) {
+ case '!':
+ $value = '|';
+ break;
case 'currentmonth':
$value = $pageLang->formatNum(
MWTimestamp::getInstance( $ts )->format( 'm' ) );
break;
diff --git a/languages/messages/MessagesEn.php
b/languages/messages/MessagesEn.php
index 07a0467..cabc89c 100644
--- a/languages/messages/MessagesEn.php
+++ b/languages/messages/MessagesEn.php
@@ -209,6 +209,7 @@
'forcetoc' => array( 0, '__FORCETOC__' ),
'toc' => array( 0, '__TOC__' ),
'noeditsection' => array( 0, '__NOEDITSECTION__' ),
+ '!' => array( 1, '!' ),
'currentmonth' => array( 1, 'CURRENTMONTH',
'CURRENTMONTH2' ),
'currentmonth1' => array( 1, 'CURRENTMONTH1' ),
'currentmonthname' => array( 1, 'CURRENTMONTHNAME' ),
diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt
index 03e4959..f6238bb 100644
--- a/tests/parser/parserTests.txt
+++ b/tests/parser/parserTests.txt
@@ -88,12 +88,6 @@
!! endarticle
!! article
-Template:!
-!! text
-|
-!! endarticle
-
-!! article
Template:echo
!! text
{{{1}}}
--
To view, visit https://gerrit.wikimedia.org/r/136234
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I1f857417d224d6443504074a5add852df3975b89
Gerrit-PatchSet: 9
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Jackmcbarn <[email protected]>
Gerrit-Reviewer: Alex Monk <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: Bartosz DziewoĆski <[email protected]>
Gerrit-Reviewer: Cscott <[email protected]>
Gerrit-Reviewer: Daniel Friesen <[email protected]>
Gerrit-Reviewer: GWicke <[email protected]>
Gerrit-Reviewer: Greg Grossmeier <[email protected]>
Gerrit-Reviewer: Jackmcbarn <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: Parent5446 <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: Tim Starling <[email protected]>
Gerrit-Reviewer: devunt <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits