gukhanmun-markdown
Markdown adapter for the Gukhanmun pipeline. Parses Markdown with
pulldown-cmark, maps each event to a core token, converts hanja in text runs
while preserving code spans, code blocks, and raw HTML, then serializes the
output back to Markdown via pulldown-cmark-to-cmark.
Installation
[]
= "0.1"
Key types
MarkdownScopeData carries per-scope policy flags through the engine. A scope
represents a Markdown element (paragraph, heading, list item, etc.) or an
inline HTML node discovered inside a Markdown document. The three flags mirror
those in gukhanmun-html:
preserve: text in this scope is not converted (code spans, code blocks, raw HTML blocks).allows_inline_markup: whether the renderer may emit<ruby>or parenthetical markup.block_boundary: whether this scope resets the homophone-disambiguation window.
Inline HTML inside Markdown is re-scanned for lang attributes, and the
gukhanmun-html classifier is consulted to determine the policy for any
recognized HTML elements.
Usage
The adapter is typically invoked through the gukhanmun umbrella crate's
Converter::convert_markdown_to_string method. Direct use:
use ;
use ;
let mut dict = new;
dict.insert;
let output = convert_markdown?;
// output is semantically equivalent to "# 한자\n"
MarkdownVariant::CommonMark enables no pulldown-cmark extensions.
MarkdownVariant::Gfm enables the GitHub Flavored Markdown extension set
(tables, task lists, strikethrough, footnotes).
License
GPL-3.0-only. See LICENSE at the repository root.