From: Liangent
Date: Fri, 21 Dec 2012 09:55:57 +0000 (+0800)
Subject: Use proper function recursiveConvertTopLevel() in recursive conversion
X-Git-Tag: 1.31.0-rc.0~21157^2
X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/message.php?a=commitdiff_plain;h=27950be750962e9f92f86b6cfc579bd3443a7b59;p=lhc%2Fweb%2Fwiklou.git
Use proper function recursiveConvertTopLevel() in recursive conversion
so that conversion of alt and title attrs doesn't clear converter state.
Change-Id: Icb6e5e1fa71768ac306c9ac4bca9f58845a3e457
---
diff --git a/languages/LanguageConverter.php b/languages/LanguageConverter.php
index fed8835f7b..43afe65326 100644
--- a/languages/LanguageConverter.php
+++ b/languages/LanguageConverter.php
@@ -410,7 +410,7 @@ class LanguageConverter {
$attr = $attrs[$attrName];
// Don't convert URLs
if ( !strpos( $attr, '://' ) ) {
- $attr = $this->convertTo( $attr, $toVariant );
+ $attr = $this->recursiveConvertTopLevel( $attr, $toVariant );
}
// Remove HTML tags to avoid disrupting the layout
diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt
index af4d218e08..6bf564d622 100644
--- a/tests/parser/parserTests.txt
+++ b/tests/parser/parserTests.txt
@@ -10987,6 +10987,20 @@ China
!! end
+!! test
+Recursive conversion of alt and title attrs shouldn't clear converter state
+!! options
+language=zh variant=zh-cn showtitle
+!! input
+-{H|zh-cn:Exclamation;zh-tw:exclamation;}-
+Should be stripped-{T|zh-cn:China;zh-tw:Taiwan}-!
+!! result
+China
+
+Should be stripped!
+
+!! end
+
!! test
Bug 24072: more test on conversion rule for title
!! options