* src/docgen/KwordDoc.py: add support for superscripts
svn: r1729
This commit is contained in:
parent
c31b7c26d4
commit
baeb2fb412
@ -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 = '<FORMAT id="1" pos="%d" len="%d">\n' % (self.start_pos, end)
|
||||
txt = txt + '<VERTALIGN value="2"/></FORMAT>\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")
|
||||
|
Loading…
Reference in New Issue
Block a user