Commit 32418024 authored by Jérome Perrin's avatar Jérome Perrin

Formulator: Update OOoEscaper for python3 re.sub behavior

parent 14080e7f
...@@ -72,7 +72,7 @@ class OOoEscaper: ...@@ -72,7 +72,7 @@ class OOoEscaper:
self.parent_node = parent_node self.parent_node = parent_node
def __call__(self, match_object): def __call__(self, match_object):
match_value = match_object.group(1) match_value = match_object.group(1)
if match_value is None: if match_value is None and match_object.group(2):
self.parent_node.text = convert_to_xml_compatible_string(match_object.group(2)) self.parent_node.text = convert_to_xml_compatible_string(match_object.group(2))
elif match_value == '\n': elif match_value == '\n':
line_break = SubElement(self.parent_node, '{%s}%s' % (TEXT_URI, 'line-break')) line_break = SubElement(self.parent_node, '{%s}%s' % (TEXT_URI, 'line-break'))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment