From: Platonides Date: Sun, 6 Nov 2011 15:07:34 +0000 (+0000) Subject: Bug 26375 - Italics should be passed to TOC X-Git-Tag: 1.31.0-rc.0~26679 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=c77380f9c22f13be595ab52d6891a02fa7d88aca;p=lhc%2Fweb%2Fwiklou.git Bug 26375 - Italics should be passed to TOC http://en.wikipedia.org/w/index.php?title=Wikipedia:Village_pump_%28technical%29&oldid=403630551#Italics_in_ToC --- diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 660f72030f..d3338629fc 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -4043,9 +4043,9 @@ class Parser { # link text with suffix $safeHeadline = $this->replaceLinkHoldersText( $safeHeadline ); - # Strip out HTML (other than plain and : bug 8393) + # Strip out HTML (other than plain and : bug 8393, or : bug 26375) $tocline = preg_replace( - array( '#<(?!/?(sup|sub)).*?'.'>#', '#<(/?(sup|sub)).*?'.'>#' ), + array( '#<(?!/?(sup|sub|i)).*?'.'>#', '#<(/?(sup|sub|i)).*?'.'>#' ), array( '', '<$1>' ), $safeHeadline ); diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index 390ad06828..b038db2be3 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -8874,6 +8874,23 @@ language=en

!! end +!! test +Bug 26375: TOC with italics +!! options +title=[[Main Page]] +!! input +__TOC__ +== ''Lost'' episodes == +!! result +

Contents

+ +
+

[edit] Lost episodes

+ +!! end + TODO: more images more tables