Skip to content

Commit

Permalink
Add support for strikethrough in the RTF reader.
Browse files Browse the repository at this point in the history
  • Loading branch information
mihaip committed Aug 20, 2014
1 parent cc05989 commit 91f8ace
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyth/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class Text(_PythBase):
They do not inherit their properties from anything.
"""

validProperties = ('bold', 'italic', 'underline', 'url', 'sub', 'super')
validProperties = ('bold', 'italic', 'underline', 'url', 'sub', 'super', 'strike')
contentType = unicode

def __repr__(self):
Expand Down
5 changes: 5 additions & 0 deletions pyth/plugins/rtf15/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,11 @@ def handle_ul(self, onOff=None):
self.content.append(ReadableMarker("underline", val))


def handle_strike(self, onOff=None):
val = onOff in (None, "", "1")
self.content.append(ReadableMarker("strike", val))


def handle_ilvl(self, level):
if self.currentParaTag is not None:
self.currentParaTag.listLevel = level
Expand Down

0 comments on commit 91f8ace

Please sign in to comment.