https://www.mediawiki.org/wiki/Special:Code/MediaWiki/102179

Revision: 102179
Author:   platonides
Date:     2011-11-06 15:07:34 +0000 (Sun, 06 Nov 2011)
Log Message:
-----------
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

Modified Paths:
--------------
    trunk/phase3/includes/parser/Parser.php
    trunk/phase3/tests/parser/parserTests.txt

Modified: trunk/phase3/includes/parser/Parser.php
===================================================================
--- trunk/phase3/includes/parser/Parser.php     2011-11-06 15:06:09 UTC (rev 
102178)
+++ trunk/phase3/includes/parser/Parser.php     2011-11-06 15:07:34 UTC (rev 
102179)
@@ -4043,9 +4043,9 @@
                        #     link text with suffix
                        $safeHeadline = $this->replaceLinkHoldersText( 
$safeHeadline );
 
-                       # Strip out HTML (other than plain <sup> and <sub>: bug 
8393)
+                       # Strip out HTML (other than plain <sup> and <sub>: bug 
8393, or <i>: bug 26375)
                        $tocline = preg_replace(
-                               array( '#<(?!/?(sup|sub)).*?'.'>#', 
'#<(/?(sup|sub)).*?'.'>#' ),
+                               array( '#<(?!/?(sup|sub|i)).*?'.'>#', 
'#<(/?(sup|sub|i)).*?'.'>#' ),
                                array( '',                          '<$1>' ),
                                $safeHeadline
                        );

Modified: trunk/phase3/tests/parser/parserTests.txt
===================================================================
--- trunk/phase3/tests/parser/parserTests.txt   2011-11-06 15:06:09 UTC (rev 
102178)
+++ trunk/phase3/tests/parser/parserTests.txt   2011-11-06 15:07:34 UTC (rev 
102179)
@@ -8874,6 +8874,23 @@
 </p>
 !! end
 
+!! test
+Bug 26375: TOC with italics
+!! options
+title=[[Main Page]]
+!! input
+__TOC__
+== ''Lost'' episodes ==
+!! result
+<table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
+<ul>
+<li class="toclevel-1 tocsection-1"><a href="#Lost_episodes"><span 
class="tocnumber">1</span> <span class="toctext"><i>Lost</i> 
episodes</span></a></li>
+</ul>
+</td></tr></table>
+<h2><span class="editsection">[<a 
href="/index.php?title=Main_Page&amp;action=edit&amp;section=1" title="Edit 
section: Lost episodes">edit</a>]</span> <span class="mw-headline" 
id="Lost_episodes"> <i>Lost</i> episodes </span></h2>
+
+!! end
+
 TODO:
 more images
 more tables


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to