jenkins-bot has submitted this change and it was merged.
Change subject: Parser: Add <bdi> to the whitelist for TOC links
......................................................................
Parser: Add <bdi> to the whitelist for TOC links
Bug: 72884
Change-Id: Id5aa9a4eb32fb185881141e55de700ae36f806c5
---
M includes/parser/Parser.php
M tests/parser/parserTests.txt
2 files changed, 19 insertions(+), 2 deletions(-)
Approvals:
Siebrand: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php
index e3a4ea5..6b2444e 100644
--- a/includes/parser/Parser.php
+++ b/includes/parser/Parser.php
@@ -4636,14 +4636,15 @@
# * <sup> and <sub> (bug 8393)
# * <i> (bug 26375)
# * <b> (r105284)
+ # * <bdi> (bug 72884)
# * <span dir="rtl"> and <span dir="ltr"> (bug 35167)
#
# We strip any parameter from accepted tags (second
regex), except dir="rtl|ltr" from <span>,
# to allow setting directionality in toc items.
$tocline = preg_replace(
array(
- '#<(?!/?(span|sup|sub|i|b)(?:
[^>]*)?>).*?' . '>#',
- '#<(/?(?:span(?:
dir="(?:rtl|ltr)")?|sup|sub|i|b))(?: .*?)?' . '>#'
+ '#<(?!/?(span|sup|sub|bdi|i|b)(?:
[^>]*)?>).*?' . '>#',
+ '#<(/?(?:span(?:
dir="(?:rtl|ltr)")?|sup|sub|bdi|i|b))(?: .*?)?' . '>#'
),
array( '', '<$1>' ),
$safeHeadline
diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt
index cf9d829..7eb152a 100644
--- a/tests/parser/parserTests.txt
+++ b/tests/parser/parserTests.txt
@@ -19043,6 +19043,22 @@
!! end
+!! test
+Bug 72884: bdi element in ToC
+!! wikitext
+__TOC__
+== <bdi>test</bdi> ==
+!! html
+<div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
+<ul>
+<li class="toclevel-1 tocsection-1"><a href="#test"><span
class="tocnumber">1</span> <span class="toctext"><bdi>test</bdi></span></a></li>
+</ul>
+</div>
+
+<h2><span class="mw-headline" id="test"><bdi>test</bdi></span><span
class="mw-editsection"><span class="mw-editsection-bracket">[</span><a
href="/index.php?title=Parser_test&action=edit&section=1" title="Edit
section: test">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
+
+!! end
+
!! article
MediaWiki:Bug32057
!! text
--
To view, visit https://gerrit.wikimedia.org/r/170589
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Id5aa9a4eb32fb185881141e55de700ae36f806c5
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TheDJ <[email protected]>
Gerrit-Reviewer: Amire80 <[email protected]>
Gerrit-Reviewer: Cscott <[email protected]>
Gerrit-Reviewer: GWicke <[email protected]>
Gerrit-Reviewer: Jackmcbarn <[email protected]>
Gerrit-Reviewer: Reedy <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: Subramanya Sastry <[email protected]>
Gerrit-Reviewer: Tim Starling <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits