moonmarkdown

A CommonMark spec-compliant Markdown to HTML parser written in pure MoonBit

markdown
commonmark
html
parser
gfm
moon add oilleelssq-wq/moonmarkdown@0.2.0
Download zip
Version
0.2.0
License
MIT
Last updated
27 days ago
Downloads
16

Dependencies

README

#oilleelssq-wq/moonmarkdown

A CommonMark spec-compliant Markdown to HTML parser written in pure MoonBit.

#Quick start

///|
test "md_to_html" {
let html = @moonmarkdown.md_to_html("# Hello\n\n**bold** text")
inspect(html, content="<h1>Hello</h1>\n<p><strong>bold</strong> text</p>\n")
}

#
md_to_html

fn md_to_html(input : String) -> String

Parse Markdown and render to HTML in one call.

This is the simplest API for most use cases:

let html = @moonmarkdown.md_to_html("*Hello* World")
// html == "<p><em>Hello</em> World</p>\n"

#
md_to_html_with_options

fn md_to_html_with_options(input : String, options :
MarkdownOptions
) -> String

Parse Markdown and render to HTML in one call with explicit options.

#
parse

Parse Markdown source text into an AST.

Returns a Block::Document containing the top-level block nodes.

#
parse_with_options

Parse Markdown source text into an AST with explicit options.

#
render

Render an AST to HTML string.

Performs depth-first traversal of block and inline nodes with automatic HTML entity escaping.

#
render_with_options

Render an AST to HTML string with explicit options.

Source Files

Powered by MoonBit

Site sourceReport issuePackagesBuild queueSkillsStatistics

© 2026 mooncakes.io