code: function toHast(tree, options) {
    var h = factory(tree, options)
    var node = one(h, tree)
    var footnotes = footer(h)
  
    if (node && node.children && footnotes) {
      node.children = node.children.concat(u('text', '\n'), footnotes)
    }
  
    return node
  }
docs: Transform `tree`, which is an mdast node, to a hast node.