added additional unit-test, cleaned up spacing

This commit is contained in:
Connor Tumbleson 2015-03-01 10:11:33 -06:00
parent 5076612c87
commit d9fda1feda
2 changed files with 11 additions and 10 deletions

View File

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

View File

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