Compare commits
1 commit
881b659560
...
e1d01001ab
| Author | SHA1 | Date | |
|---|---|---|---|
| e1d01001ab |
1 changed files with 15 additions and 0 deletions
15
secretary.py
15
secretary.py
|
|
@ -439,6 +439,21 @@ class Renderer(object):
|
||||||
|
|
||||||
return xml_text
|
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=''):
|
def add_media_to_archive(self, media, mime, name=''):
|
||||||
"""
|
"""
|
||||||
Adds to "Pictures" archive folder the file in `media` and register
|
Adds to "Pictures" archive folder the file in `media` and register
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue