Skip to content

Commit

Permalink
Fix disappearing-space bug in RTF reader
Browse files Browse the repository at this point in the history
  • Loading branch information
brendonh committed Dec 23, 2009
1 parent 5fe0669 commit ba62512
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion examples/reading/rtf15.py
@@ -1,7 +1,14 @@
from pyth.plugins.rtf15.reader import Rtf15Reader
from pyth.plugins.xhtml.writer import XHTMLWriter

doc = Rtf15Reader.read(open('sample.rtf'))
import sys

if len(sys.argv) > 1:
filename = sys.argv[1]
else:
filename = "sample.rtf"

doc = Rtf15Reader.read(open(filename))

print XHTMLWriter.write(doc, pretty=True).read()

Expand Down
2 changes: 1 addition & 1 deletion pyth/plugins/rtf15/reader.py
Expand Up @@ -212,7 +212,7 @@ def cleanParagraph(self):

for run in runs:

if run.content[0].strip():
if run.content[0]:
hasContent = True
else:
continue
Expand Down

0 comments on commit ba62512

Please sign in to comment.