Skip to content

Hongdown 0.5.0

Latest

Choose a tag to compare

@github-actions github-actions released this 21 Jun 08:29
· 1 commit to main since this release
0.5.0
857914d

Released on June 21, 2026.

  • Added MDX support. MDX documents embed JavaScript and JSX that Comrak (the underlying CommonMark parser) does not understand, so Hongdown used to mangle them—turning straight quotes into curly quotes, backslash-escaping Markdown punctuation, and collapsing indentation. When MDX mode is enabled, Hongdown now detects those constructs and preserves them verbatim while still formatting the surrounding Markdown prose.

    Within Markdown prose, the protected constructs are ESM import/export statements, JSX elements and fragments, and {…} expressions (including JSX comments like {/* … */}). The embedded JavaScript/JSX is preserved as-is, not reformatted; constructs that the underlying parser already handles correctly—such as a valid inline-HTML JSX tag or a {#id} heading anchor—are left to it.

    MDX mode is enabled automatically for files with the .mdx extension, which are now also discovered when a directory is passed on the command line. It can be turned on explicitly for stdin or .md input with the --mdx command-line flag or the mdx option in .hongdown.toml (Rust API: Options.mdx, type bool; WASM/JavaScript: mdx, type boolean). All default to off, so non-MDX documents are unaffected. [#22, #23]

  • Fixed a bug where a document whose only content was one or more HTML blocks (for example a single HTML comment) gained two spurious leading blank lines. [#23]

  • Fixed a bug where two consecutive trailing HTML blocks that were separated by a blank line in the source were emitted on adjacent lines, dropping the blank line between them. [#23]

  • Added an official Visual Studio Code extension. The extension formats Markdown and MDX documents with a bundled WebAssembly build by default, can be configured to run a system Hongdown CLI instead, and is packaged as a .vsix artifact by CI. Tag releases publish the same .vsix to GitHub Releases, Visual Studio Marketplace, and Open VSX Registry.

  • Added loadConfigFromToml() and headingAnchorAlign to the WASM/JavaScript API so editor integrations can reuse .hongdown.toml settings without shelling out to the CLI. External code block formatters in code_block.formatters are reported as warnings because the WASM runtime cannot execute external commands.