Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pyth/plugins/plaintext/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ def go(self):
def paragraph(self, paragraph, prefix=""):
content = []
for text in paragraph.content:
if text.__class__ is document.Image:
continue
content.append(u"".join(text.content))
content = u"".join(content).encode("utf-8")

Expand Down
16 changes: 13 additions & 3 deletions pyth/plugins/rtf15/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,19 @@ def getControl(self):
first = False

if next == "'":
# ANSI escape, takes two hex digits
chars.extend("ansi_escape")
digits.extend(self.source.read(2))
possible_digits = self.source.read(2)
try:
# Test for ANSI escape
true_digits = [
int(possible_digits[0], 16),
int(possible_digits[1], 16)
]
# ANSI escape, takes two hex digits
chars.extend("ansi_escape")
digits.extend(true_digits)
except ValueError:
# It's just an escaped quote mark, so reset the file header
self.source.seek(-2, 1)
break

if next == ' ':
Expand Down