Skip to content

Commit

Permalink
Merge pull request #110 from transifex/devel_copy
Browse files Browse the repository at this point in the history
Fix xliff:g tag escaping in android xml
  • Loading branch information
nbasili committed Aug 21, 2018
2 parents d789bdf + a7be0f6 commit ddbc3a6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion openformats/formats/android.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ def _should_ignore(child):
# According to:
# http://developer.android.com/guide/topics/resources/string-resource.html#FormattingAndStyling # noqa

INLINE_TAGS = ("xliff\:g", "a")
INLINE_TAGS = ("xliff:g", "a", "annotation")

@staticmethod
def escape(string):
Expand Down
7 changes: 7 additions & 0 deletions openformats/tests/formats/android/test_android.py
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,13 @@ def test_escape(self):
# Single tags
(u'<a b="c" />', u'<a b="c" />'),
(u'<x y="z" />', u'<x y=\\"z\\" />'),
# xliff:g tag
(u'<xliff:g y="z">hello</xliff:g>',
u'<xliff:g y="z">hello</xliff:g>'),
# annotation tag
(u'<annotation y="z">hello</annotation>',
u'<annotation y="z">hello</annotation>'),

)
for rich, raw in cases:
self.assertEquals(AndroidHandler.escape(bytes_to_string(rich)),
Expand Down

0 comments on commit ddbc3a6

Please sign in to comment.