Use proper function recursiveConvertTopLevel() in recursive conversion
authorLiangent <liangent@gmail.com>
Fri, 21 Dec 2012 09:55:57 +0000 (17:55 +0800)
committerLiangent <liangent@gmail.com>
Fri, 21 Dec 2012 09:55:57 +0000 (17:55 +0800)
so that conversion of alt and title attrs doesn't clear converter state.

Change-Id: Icb6e5e1fa71768ac306c9ac4bca9f58845a3e457

languages/LanguageConverter.php
tests/parser/parserTests.txt

index fed8835..43afe65 100644 (file)
@@ -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
index af4d218..6bf564d 100644 (file)
@@ -10987,6 +10987,20 @@ China
 </p>
 !! 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}-<span title="exclamation">!</span>
+!! result
+China
+<p>
+Should be stripped<span title="Exclamation">!</span>
+</p>
+!! end
+
 !! test
 Bug 24072: more test on conversion rule for title
 !! options