aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2015-06-17 15:43:02 +0100
committerMichael Williamson <mike@zwobble.org>2015-06-17 15:43:02 +0100
commit62e6d800f0dd5b649ed094c3879e57a9c50dab8a (patch)
treec36176d5e77b868e44091de23b779123ea5b9c9e
parenta52d99fd85061a9f20b481535407a225d5927434 (diff)
Document strikethrough support
-rw-r--r--NEWS2
-rw-r--r--README.md28
2 files changed, 30 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 3d0d733..d6876f9 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,8 @@
* Add support for underlines in style map.
+* Add support for strikethrough.
+
# 0.3.21
* Add basic support for text boxes. The contents of the text box are treated as
diff --git a/README.md b/README.md
index 76dc8c6..1f95160 100644
--- a/README.md
+++ b/README.md
@@ -233,6 +233,23 @@ var options = {
};
```
+### 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:
+
+```javascript
+var mammoth = require("mammoth");
+
+var options = {
+ styleMap: [
+ "strike => del"
+ ]
+};
+mammoth.convertToHtml({path: "path/to/document.docx"}, options);
+```
+
#### Document transforms
Mammoth allows a document to be transformed before it is converted.
@@ -486,6 +503,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