mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-09-17 10:40:12 +02:00
checkupdates: Ignore xml tags in string content
This allows us to fetch strings like the following: <string name="app_name">foo <xliff:g>bar</xliff:g></string> Up until now, using .text would only return "foo ", but if we use .tostring() with the text method, it converts everything into plain text for us resulting in "foo bar".
This commit is contained in:
parent
79475d055f
commit
4ea5ce8889
@ -911,7 +911,7 @@ def retrieve_string(app_dir, string, xmlfiles=None):
|
|||||||
def element_content(element):
|
def element_content(element):
|
||||||
if element.text is None:
|
if element.text is None:
|
||||||
return ""
|
return ""
|
||||||
return element.text.encode('utf-8')
|
return XMLElementTree.tostring(element, encoding='utf-8', method='text')
|
||||||
|
|
||||||
for path in xmlfiles:
|
for path in xmlfiles:
|
||||||
if not os.path.isfile(path):
|
if not os.path.isfile(path):
|
||||||
|
Loading…
Reference in New Issue
Block a user