From: Derk-Jan Hartman Date: Sun, 2 Nov 2014 17:19:56 +0000 (+0100) Subject: Parser: Add to the whitelist for TOC links X-Git-Tag: 1.31.0-rc.0~12851^2 X-Git-Url: http://git.cyclocoop.org//%27http:/code.google.com/p/ie7-js//%27?a=commitdiff_plain;h=e20e64eb6bd8b4c22491a1aebe2792618fd39ea2;p=lhc%2Fweb%2Fwiklou.git Parser: Add to the whitelist for TOC links Bug: 72884 Change-Id: Id5aa9a4eb32fb185881141e55de700ae36f806c5 --- diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index e3a4ea57eb..6b2444ebb5 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -4636,14 +4636,15 @@ class Parser { # * and (bug 8393) # * (bug 26375) # * (r105284) + # * (bug 72884) # * and (bug 35167) # # We strip any parameter from accepted tags (second regex), except dir="rtl|ltr" from , # 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 cf9d829975..7eb152ab8e 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -19043,6 +19043,22 @@ __TOC__ !! end +!! test +Bug 72884: bdi element in ToC +!! wikitext +__TOC__ +== test == +!! html +

Contents

+ +
+ +

test[edit]

+ +!! end + !! article MediaWiki:Bug32057 !! text