summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2014-07-18 15:09:53 +0100
committerMichael Williamson <mike@zwobble.org>2014-07-18 15:09:53 +0100
commitfd441921bbca504bd14f18ec0ae2bc0063397760 (patch)
tree7b02b46e5d9fb7a163dc1a05a636feb81247feef
parentfe8918642d9d95bbc099993b96e845bdc17215e1 (diff)
Document convertUnderline
-rw-r--r--README.md19
1 files changed, 18 insertions, 1 deletions
diff --git a/README.md b/README.md
index b583843..e53dfaf 100644
--- a/README.md
+++ b/README.md
@@ -30,7 +30,7 @@ The following features are currently supported:
* Images.
-* Bold and italics.
+* Bold, italics and underlines.
* Links.
@@ -191,6 +191,20 @@ 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)`.
+
+For instance, suppose that a source document uses underlining for emphasis.
+The following will wrap any underlined source text in `<em>` tags:
+
+```javascript
+var options = {
+ convertUnderline: mammoth.images.underline("em")
+};
+```
+
#### Document transforms
Mammoth allows a document to be transformed before it is converted.
@@ -268,6 +282,9 @@ Converts the source document to HTML.
* `convertImage`: by default, images are converted to `<img>` elements with the source included inline in the `src` attribute.
Set this option to an [image converter](#image-converters) to override the default behaviour.
+
+ * `convertUnderline`: by default, the underlining of any text is ignored.
+ Set this option to [`mammoth.underline.element(name)`](#underline) to override the default behaviour.
* Returns a promise containing a result.
This result has the following properties: