From 30cdc0c5b99ca7c45f74c7a038b3739e12e27f2f Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Wed, 17 Jun 2015 15:56:39 +0100 Subject: Document strikethrough support --- README.md | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index fd2d31e..2fc739b 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ The following features are currently supported: * Images. -* Bold, italics, underlines, superscript and subscript. +* Bold, italics, underlines, strikethrough, superscript and subscript. * Links. @@ -190,6 +190,19 @@ The following behaves as the example above: mammoth.convert_to_html(docx_file, convert_underline=mammoth.underline.element("em")) ``` +### Strikethrough + +By default, strikethrough text is wrapped in `` tags. +This behaviour can be changed by adding a style mapping for `strike`. +For instance, to wrap strikethrough text in `` tags: + +```python +style_map = "strike => del" + +with open("document.docx", "rb") as docx_file: + result = mammoth.convert_to_html(docx_file, style_map=style_map) +``` + ### API #### `mammoth.convert_to_html(fileobj, style_map=None, include_default_style_map=True)` @@ -365,6 +378,17 @@ u Note that this matches text that has had underline explicitly applied to it. It will not match any text that is underlined because of its paragraph or run style. +#### Strikethough + +Match explicitly struckthrough text: + +``` +strike +``` + +Note that this matches text that has had strikethrough explicitly applied to it. +It will not match any text that is struckthrough because of its paragraph or run style. + ### HTML paths #### Single elements -- cgit v1.2.3