Capy-Bearer Documentation

markdown_to_ast

lib call

Capy

function markdown_to_ast(source : string) any
function markdown_to_ast(source : string, options : any) any

Description

markdown_to_ast() parses Markdown into an any 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")

Output

document