Skip to content

renderHtmlWithDiagnostics

renderHtmlWithDiagnostics(source, options?): MdiRenderResult<string>

Defined in: mdi/src/index.ts:206

Render HTML while retaining the Rust parser result that made the semantic decisions. Use this in editors: warnings and source spans remain available instead of being silently discarded, and headings can drive navigation or chapter controls without scraping generated HTML.

The low-level Rust ABI currently accepts source for rendering, rather than a serializable IR handle. This helper therefore validates with the same Rust parser immediately before rendering and returns that exact parse result.

string

MdiHtmlRenderOptions

MdiRenderResult<string>