diff options
| -rw-r--r-- | NEWS | 2 | ||||
| -rw-r--r-- | README.md | 26 |
2 files changed, 27 insertions, 1 deletions
@@ -2,6 +2,8 @@ * Add support for underlines in style map. +* Add support for strikethrough. + # 0.3.16 * Add basic support for text boxes. The contents of the text box are treated as @@ -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 `<s>` tags. +This behaviour can be changed by adding a style mapping for `strike`. +For instance, to wrap strikethrough text in `<del>` 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 |
