pub fn generate_html_with_options_wasm(
markdown: &str,
options_json: &str,
) -> Result<String, JsValue>Expand description
Render Markdown with a JSON-encoded subset of HtmlConfig.
The JSON object accepts these keys (all optional, all booleans
or strings, defaults match HtmlConfig::default):
add_aria_attributes(bool) — inject ARIA labels and roles.generate_toc(bool) — replace the[[TOC]]placeholder with a generated table of contents.generate_structured_data(bool) — emit a<script type="application/ld+json">JSON-LD block.generate_full_document(bool) — wrap output in<!DOCTYPE html>.enable_math(bool) — render$..$and$$..$$to MathML (requires themathfeature, on by default).enable_diagrams(bool) — rewrite mermaid fenced blocks for client-side mermaid.js.language(string) — BCP 47 language code for the<html>langattribute when full-document mode is on.minify_output(bool) — minify the final HTML.
File-I/O fields (encoding, max_buffer_size) are accepted for
shape compatibility but ignored: WASM has no host filesystem.
§Errors
Returns a JsValue carrying:
"invalid options JSON: …"ifoptions_jsondoes not parse as a JSON object.- The
crate::error::HtmlErrordisplay string when the underlying render fails.