html_generator::generator

Function markdown_to_html_with_extensions

source
pub fn markdown_to_html_with_extensions(markdown: &str) -> Result<String>
Expand description

Convert Markdown to HTML with specified extensions using mdx-gen.

This function applies a set of extensions to enhance the conversion process, such as syntax highlighting, enhanced table formatting, custom blocks, and more.

§Arguments

  • markdown - A string slice that holds the Markdown content to convert.

§Returns

  • Result<String> - The generated HTML or an error if the conversion fails.

§Example

use html_generator::generator::markdown_to_html_with_extensions;
let markdown = "~~strikethrough~~";
let html = markdown_to_html_with_extensions(markdown).unwrap();
assert!(html.contains("<del>strikethrough</del>"));