Ampersand in "<" gets replaced with "&" in plural strings

This commit is contained in:
Jeremy Hornberger
2015-03-01 00:28:03 -06:00
committed by Connor Tumbleson
parent bd566f2670
commit 5076612c87
3 changed files with 11 additions and 4 deletions

View File

@ -1009,10 +1009,13 @@ public class MXSerializer implements XmlSerializer {
}
} else {
if (ch == '&') {
if (i > pos)
out.write(text.substring(pos, i));
out.write("&");
pos = i + 1;
if(!(i < text.length() - 3 && text.charAt(i+1) == 'l'
&& text.charAt(i+2) == 't' && text.charAt(i+3) == ';')){
if (i > pos)
out.write(text.substring(pos, i));
out.write("&amp;");
pos = i + 1;
}
} else if (ch == '<') {
if (i > pos)
out.write(text.substring(pos, i));

View File

@ -16,4 +16,7 @@
<item quantity="other">foo %d</item>
<item quantity="one">foo 1</item>
</plurals>
<plurals name="issue658">
<item quantity="one">&lt;b>%d&lt;/b> guide123</item>
</plurals>
</resources>