markdown_to_ast
host callCapy
function markdown_to_ast(source : string) dval function markdown_to_ast(source : string, options : dval) dval
Description
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.
Parameters
source : the Markdown source text
options : parser options
Return Values
the Markdown document tree
Example
Capy
var document := markdown_to_ast("# Title")
print(document["type"], "\n")