diff --git a/src/plugins/docgen/ODFDoc.py b/src/plugins/docgen/ODFDoc.py index 8ebf9a8d3..0bfcba732 100644 --- a/src/plugins/docgen/ODFDoc.py +++ b/src/plugins/docgen/ODFDoc.py @@ -1216,6 +1216,9 @@ class ODFDoc(BaseDoc, TextDoc, DrawDoc): """ text = str(styledtext) s_tags = styledtext.get_tags() + text = text.replace('&', '\1') # must be the first + text = text.replace('<', '\2') + text = text.replace('>', '\3') markuptext = self._backend.add_markup_from_styled(text, s_tags) # we need to know if we have new styles to add. # if markuptext contains : FontColor, FontFace, FontSize ... @@ -1234,6 +1237,9 @@ class ODFDoc(BaseDoc, TextDoc, DrawDoc): start = m.end() linenb = 1 self.start_paragraph(style_name) + markuptext = markuptext.replace('\1', '&') # must be the first + markuptext = markuptext.replace('\2', '<') + markuptext = markuptext.replace('\3', '>') for line in markuptext.split('\n'): if ( linenb > 1 ): self.cntnt.write('')