summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rw-r--r--README.md26
2 files changed, 27 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index cdbda13..39eabbb 100644
--- a/NEWS
+++ b/NEWS
@@ -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
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 `<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