File tree 2 files changed +8
-1
lines changed
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) {
20
20
21
21
h . handlers = xtend ( handlers , settings . handlers || { } )
22
22
h . augment = augment
23
- h . document = settings . document
24
23
24
+ h . document = settings . document
25
25
h . checked = settings . checked || '[x]'
26
26
h . unchecked = settings . unchecked || '[ ]'
27
27
h . quotes = settings . quotes || [ '"' ]
@@ -53,6 +53,7 @@ function toMdast(tree, options) {
53
53
return augment ( node , result )
54
54
}
55
55
56
+ // To do: inline in a future major.
56
57
// `right` is the finalized mdast node, created from `left`, a hast node.
57
58
function augment ( left , right ) {
58
59
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
72
72
[ * elements* ] [ element ] or [ * nodes* ] [ hast-node ] .
73
73
See [ ` handlers/ ` ] [ handlers ] for examples.
74
74
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
+
75
81
###### ` options.document `
76
82
77
83
Whether the given [ * tree* ] [ tree ] is a complete document.
You can’t perform that action at this time.
0 commit comments