From: C. Scott Ananian Date: Fri, 16 Dec 2016 18:41:51 +0000 (-0500) Subject: Allow HTML tags in LanguageConverter output. X-Git-Tag: 1.31.0-rc.0~4488 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=5b050be643e26c7b7d1b2b160a9878b992a2f71d;p=lhc%2Fweb%2Fwiklou.git 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 --- 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