File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -20,8 +20,8 @@ function toMdast(tree, options) {
2020
2121 h . handlers = xtend ( handlers , settings . handlers || { } )
2222 h . augment = augment
23- h . document = settings . document
2423
24+ h . document = settings . document
2525 h . checked = settings . checked || '[x]'
2626 h . unchecked = settings . unchecked || '[ ]'
2727 h . quotes = settings . quotes || [ '"' ]
@@ -53,6 +53,7 @@ function toMdast(tree, options) {
5353 return augment ( node , result )
5454 }
5555
56+ // To do: inline in a future major.
5657 // `right` is the finalized mdast node, created from `left`, a hast node.
5758 function augment ( left , right ) {
5859 if ( left . position ) {
Original file line number Diff line number Diff line change @@ -72,6 +72,12 @@ Object mapping tag names or [*types*][type] to functions handling those
7272[ * elements* ] [ element ] or [ * nodes* ] [ hast-node ] .
7373See [ ` handlers/ ` ] [ handlers ] for examples.
7474
75+ In a handler, you have access to ` h ` , which should be used to create mdast nodes
76+ from hast nodes.
77+ On ` h ` , there are fields that may be of interest.
78+ Most interesting of them is ` h.wrapText ` , which is ` true ` if the mdast content
79+ can include newlines, and ` false ` if not (such as in headings or table cells).
80+
7581###### ` options.document `
7682
7783Whether the given [ * tree* ] [ tree ] is a complete document.
You can’t perform that action at this time.
0 commit comments