From 91f8ace3ce0a3cb4e3944f524d4b42bc8885d97d Mon Sep 17 00:00:00 2001 From: Mihai Parparita Date: Wed, 20 Aug 2014 16:05:37 -0700 Subject: [PATCH] Add support for strikethrough in the RTF reader. --- pyth/document.py | 2 +- pyth/plugins/rtf15/reader.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pyth/document.py b/pyth/document.py index 77eafc3..864d519 100644 --- a/pyth/document.py +++ b/pyth/document.py @@ -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): diff --git a/pyth/plugins/rtf15/reader.py b/pyth/plugins/rtf15/reader.py index 1ea9c3f..581d55a 100644 --- a/pyth/plugins/rtf15/reader.py +++ b/pyth/plugins/rtf15/reader.py @@ -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