:sig
function markdown_to_ast(source : string) dval
function markdown_to_ast(source : string, options : dval) dval

:params
source : the Markdown source text
options : parser options

:returns
the Markdown document tree

:content
`markdown_to_ast()` parses Markdown into a `dval` document tree.

The root node contains a `children` list. Nodes contain a `type` field and fields for their content. The default options support GitHub-flavored Markdown.

Set `gfm` to control GitHub-flavored extensions. Set `allow_html` to retain raw HTML nodes.

:example capy render
var document := markdown_to_ast("# Title")
print(document["type"], "\n")

:see-group
markdown

:see
json_encode
