Compare commits

..

1 commit

View file

@ -439,6 +439,21 @@ class Renderer(object):
return xml_text
@staticmethod
def get_escaped_var_value(value):
"""
Encodes XML reserved chars in value (eg. &, <, >) and also replaces
the control chars \n and \t control chars to their ODF counterparts.
"""
value = Markup.escape(value)
return (
value.replace('\n', Markup('<text:line-break/>'))
.replace('\t', Markup('<text:tab/>'))
.replace('\x0b', '<text:space/>')
.replace('\x0c', '<text:space/>')
)
def add_media_to_archive(self, media, mime, name=''):
"""
Adds to "Pictures" archive folder the file in `media` and register