From c77380f9c22f13be595ab52d6891a02fa7d88aca Mon Sep 17 00:00:00 2001
From: Platonides
Date: Sun, 6 Nov 2011 15:07:34 +0000
Subject: [PATCH] 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
---
includes/parser/Parser.php | 4 ++--
tests/parser/parserTests.txt | 17 +++++++++++++++++
2 files changed, 19 insertions(+), 2 deletions(-)
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
+
+[edit] Lost episodes
+
+!! end
+
TODO:
more images
more tables
--
2.20.1