From 5b050be643e26c7b7d1b2b160a9878b992a2f71d Mon Sep 17 00:00:00 2001 From: "C. Scott Ananian" Date: Fri, 16 Dec 2016 13:41:51 -0500 Subject: [PATCH] Allow HTML tags in LanguageConverter output. A "remove HTML tags to avoid disrupting the layout" block is removed (previously added in f16d1e4ed70cd5a8fa6ae6ca8bb71bfe62f4f47e). This is a follow-up to I9b099273203482ffb570a5654d8ba50c833e526d. Bug: T54192 Change-Id: I565fac58b3b0da7bfaedf64f5001c364f52e2244 --- languages/LanguageConverter.php | 2 -- tests/parser/parserTests.txt | 13 +++++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/languages/LanguageConverter.php b/languages/LanguageConverter.php index 5a9f652ef0..06fec44838 100644 --- a/languages/LanguageConverter.php +++ b/languages/LanguageConverter.php @@ -415,8 +415,6 @@ class LanguageConverter { $attr = $this->recursiveConvertTopLevel( $attr, $toVariant ); } - // Remove HTML tags to avoid disrupting the layout - $attr = preg_replace( '/<[^>]+>/', '', $attr ); if ( $attr !== $attrs[$attrName] ) { $attrs[$attrName] = $attr; $changed = true; diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index b34a03f2a3..317ab0f60a 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -14154,6 +14154,19 @@ Escape HTML special chars in image alt text

!! end +!! test +Escape HTML special chars in image alt text with LanguageConverter +!! options +language=zh +!! wikitext +[[File:Foobar.jpg|& < > "]] +!! html/php +

& < > " +

+!! html/parsoid +

+!! end + !! test Entities in file name and attributes !! wikitext -- 2.20.1