This commit is contained in:
16
node_modules/hast-util-to-mdast/lib/handlers/root.js
generated
vendored
Normal file
16
node_modules/hast-util-to-mdast/lib/handlers/root.js
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
'use strict'
|
||||
|
||||
module.exports = root
|
||||
|
||||
var all = require('../all')
|
||||
var wrap = require('../util/wrap')
|
||||
|
||||
function root(h, node) {
|
||||
var children = all(h, node)
|
||||
|
||||
if (h.document || wrap.needed(children)) {
|
||||
children = wrap(children)
|
||||
}
|
||||
|
||||
return h(node, 'root', children)
|
||||
}
|
||||
Reference in New Issue
Block a user