Parser: Add <bdi> to the whitelist for TOC links
Bug: 72884 Change-Id: Id5aa9a4eb32fb185881141e55de700ae36f806c5
This commit is contained in:
parent
61e23c0578
commit
e20e64eb6b
2 changed files with 19 additions and 2 deletions
|
|
@ -4636,14 +4636,15 @@ class Parser {
|
|||
# * <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
|
||||
|
|
|
|||
|
|
@ -19043,6 +19043,22 @@ __TOC__
|
|||
|
||||
!! 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
|
||||
|
|
|
|||
Loading…
Reference in a new issue