aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2015-06-17 14:40:37 +0100
committerMichael Williamson <mike@zwobble.org>2015-06-17 14:40:37 +0100
commit4621194f4940223b0a49e5d089111e70cb712a46 (patch)
tree69f2a2c59d200c8babbcce0f60de10a677045cd9 /README.md
parent17577bdd715c65e71d81f762b54b8c27f60f4535 (diff)
Document underline support in style maps
Diffstat (limited to 'README.md')
-rw-r--r--README.md28
1 files changed, 26 insertions, 2 deletions
diff --git a/README.md b/README.md
index bc6761f..a49656c 100644
--- a/README.md
+++ b/README.md
@@ -209,12 +209,25 @@ var options = {
#### Underline
By default, the underlining of any text is ignored since underlining can be confused with links in HTML documents.
-This behaviour can be changed by setting the `convertUnderline` option to `mammoth.underline.element(name)`.
-
+This behaviour can be changed by adding a style mapping for `u`.
For instance, suppose that a source document uses underlining for emphasis.
The following will wrap any underlined source text in `<em>` tags:
```javascript
+var mammoth = require("mammoth");
+
+var options = {
+ styleMap: [
+ "u => em"
+ ]
+};
+mammoth.convertToHtml({path: "path/to/document.docx"}, options);
+```
+
+The `convertUnderline` option is deprecated, and will be removed in Mammoth.js 1.0.
+The following behaves as the example above:
+
+```javascript
var options = {
convertUnderline: mammoth.underline.element("em")
};
@@ -462,6 +475,17 @@ For instance, to match a paragraph with the style ID `Heading1`:
p.Heading1
```
+#### Underline
+
+Match explicitly underlined text:
+
+```
+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.
+
### HTML paths
#### Single elements