From baeb2fb412822616c4eb1d9a2bf12cbb814496a5 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Sat, 14 Jun 2003 02:57:49 +0000 Subject: [PATCH] * src/docgen/KwordDoc.py: add support for superscripts svn: r1729 --- src/docgen/KwordDoc.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/docgen/KwordDoc.py b/src/docgen/KwordDoc.py index 9a4370041..e05dfa977 100644 --- a/src/docgen/KwordDoc.py +++ b/src/docgen/KwordDoc.py @@ -437,7 +437,24 @@ class KwordDoc(TextDoc.TextDoc): pass def write_text(self,text): - text = string.replace(text,'&','&'); # Must be first + text = text.replace('&','&'); # Must be first + text = text.replace('<','<'); + text = text.replace('>','>'); + + pos = text.find('<super>') + if pos >= 0: + self.start_pos = len(self.text)+pos + text = text.replace('<super>','') + pos = text.find('</super>') + if pos >= 0: + end = len(self.text)+pos - self.start_pos + text = text.replace('<super>','') + + txt = '\n' % (self.start_pos, end) + txt = txt + '\n' + text = text.replace('</super>','') + self.format_list.append(txt) + self.text = self.text + text Plugins.register_text_doc(_("KWord"),KwordDoc,1,1,1,".kwd")