aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-11-20 12:15:39 +0000
committerMichael Williamson <mike@zwobble.org>2016-11-20 12:16:49 +0000
commite09b1f797d646e240e405831a9ddccd21ca4b3f9 (patch)
tree4f5fd0a872457d5aab7c6882e43485ac076d9d6e /README.md
parentf4a6e9f3077e009ce36d03ff9fb704dc8bcff31b (diff)
Add getDescendants and getDescendantsOfType to tranforms
Diffstat (limited to 'README.md')
-rw-r--r--README.md13
1 files changed, 13 insertions, 0 deletions
diff --git a/README.md b/README.md
index 491f687..0a6add2 100644
--- a/README.md
+++ b/README.md
@@ -544,6 +544,19 @@ Returns a function that can be used as the `transformDocument` option.
This will apply the function `transformParagraph` to each paragraph element.
`transformParagraph` should return the new paragraph.
+#### `mammoth.transforms.getDescendants(element)`
+
+Gets all descendants of an element.
+
+#### `mammoth.transforms.getDescendantsOfType(element, type)`
+
+Gets all descendants of a particular type of an element.
+For instance, to get all runs within an element `paragraph`:
+
+```javascript
+var runs = mammoth.transforms.getDescendantsOfType(paragraph, "run");
+```
+
## Writing style maps
A style map is made up of a number of style mappings separated by new lines.