From 7301dccc551f90ef71454aff40498d2d6ef490ea Mon Sep 17 00:00:00 2001 From: Vassilii Khachaturov Date: Sun, 21 Jul 2013 11:08:38 +0000 Subject: [PATCH] 2974: .rtf docgen doesn't escape backslashes svn: r22703 --- gramps/plugins/docgen/rtfdoc.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gramps/plugins/docgen/rtfdoc.py b/gramps/plugins/docgen/rtfdoc.py index 206efd427..cf2b64936 100644 --- a/gramps/plugins/docgen/rtfdoc.py +++ b/gramps/plugins/docgen/rtfdoc.py @@ -477,7 +477,6 @@ class RTFDoc(BaseDoc,TextDoc): def write_text(self, text, mark=None, links=False): # Convert to unicode, just in case it's not. Fix of bug 2449. text = cuni(text) - text = text.replace('\n','\n\\par ') LOG.debug("write_text: opened: %d input text: %s" % (self.opened, text)) @@ -493,7 +492,9 @@ class RTFDoc(BaseDoc,TextDoc): # If (uni)code with more than 8 bits: # RTF req valus in decimal, not hex. self.text += '{\\uc1\\u%d\\uc0}' % ord(i) - elif i == '{' or i == '}' : + elif i == '\n': + self.text += '\n\\par '; + elif i == '{' or i == '}' or i == '\\': self.text += '\\%s' % i else: self.text += i