From 62e6d800f0dd5b649ed094c3879e57a9c50dab8a Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Wed, 17 Jun 2015 15:43:02 +0100 Subject: Document strikethrough support --- NEWS | 2 ++ README.md | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) 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 `` tags. +This behaviour can be changed by adding a style mapping for `strike`. +For instance, to wrap strikethrough text in `` 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 -- cgit v1.2.3