Oops in foramt - missed escaping brace(s)

This commit is contained in:
Ken Roberts 2016-05-27 01:29:31 -07:00
parent 9fdcd30c65
commit 96333b3f08

View File

@ -458,7 +458,7 @@ class OpenLyrics(object):
self._add_tag_to_formatting(tag, tags_element)
# Replace end tags.
for tag in end_tags:
text = text.replace('{/{tag}}'.format(tag=tag), '</tag>')
text = text.replace('{/{tag}}}'.format(tag=tag), '</tag>')
# Replace \n with <br/>.
text = text.replace('\n', '<br/>')
element = etree.XML('<lines>{text}</lines>'.format(text=text))
@ -643,7 +643,7 @@ class OpenLyrics(object):
# Append text from tail and add formatting end tag.
# TODO: Verify format() with template variables
if element.tag == NSMAP % 'tag' and use_endtag:
text += '{/{{name}}}'.format(name=element.get('name'))
text += '{/{name}}}'.format(name=element.get('name'))
# Append text from tail.
if element.tail:
text += element.tail