summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2015-06-17 15:56:39 +0100
committerMichael Williamson <mike@zwobble.org>2015-06-17 15:56:39 +0100
commit30cdc0c5b99ca7c45f74c7a038b3739e12e27f2f (patch)
tree0ef0fbb5205b0fffa767ac4023479ecaf801e653 /README.md
parentcd2a10d64f6f2a1a42c1a3f0c144a3a521083cd8 (diff)
Document strikethrough support
Diffstat (limited to 'README.md')
-rw-r--r--README.md26
1 files changed, 25 insertions, 1 deletions
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