diff --git a/src/filters/rcldoc.py b/src/filters/rcldoc.py index d6bd06fe..104c420d 100755 --- a/src/filters/rcldoc.py +++ b/src/filters/rcldoc.py @@ -12,7 +12,7 @@ import os class WordProcessData: def __init__(self, em): self.em = em - self.out = b'' + self.out = [] self.cont = b'' self.gotdata = False # Line with continued word (ending in -) @@ -26,10 +26,10 @@ class WordProcessData: if not self.gotdata: if line == b'': return - self.out = b'
' + b'
') self.gotdata = True if self.cont: @@ -37,7 +37,7 @@ class WordProcessData: self.cont = "" if line == b'\f': - self.out += '
' + self.out.append('
')
return
if self.patcont.search(line):
@@ -51,30 +51,30 @@ class WordProcessData:
line = b''
if line:
- self.out += self.em.htmlescape(line) + b'
'
+ self.out.append(self.em.htmlescape(line) + b'
')
else:
- self.out += b'
'
+ self.out.append(b'
')
def wrapData(self):
if self.gotdata:
- self.out += b'
', line):
inbody = True
- output += line + b'\n'
+ output.append(line)
- return output, isempty
+ return b'\n'.join(output), isempty
def _metatag(self, nm, val):
return "''' + \
- b'''''' + \
- b''''''
+ self.out.append(b'' + \
+ b'' + \
+ b'')
self.gotdata = True
- self.out += self.em.htmlescape(line) + b"
\n"
+ self.out.append(self.em.htmlescape(line))
def wrapData(self):
- return self.out + b''''''
+ return b'\n'.join(self.out) + b'''