Added comment for replace_apostrophes function in write_xml

This commit is contained in:
Filip Gurbal 2019-11-04 14:04:50 +01:00
parent b3b33c902a
commit 989ff6d367

View file

@ -293,9 +293,9 @@ def indent(elem, level=0):
def write_xml(content, file):
with open(file, 'w') as infile:
# replace apostrophes with double quotes only in xml keys, not texts
def replace_apostrophes(match):
return match.group(0).replace("'", '"')
content = re.sub("<(.*?)>", replace_apostrophes, content)
content = content.replace('?>', ' standalone="yes" ?>', 1)