Skip to main content

process_markdown

Function process_markdown 

Source
pub fn process_markdown(
    content: &str,
    options: &MarkdownOptions<'_>,
) -> Result<String, MarkdownError>
Expand description

Processes the input Markdown content and converts it into HTML.

The pipeline:

  1. Validate options and check resource limits.
  2. Parse Markdown to a comrak AST.
  3. (Optional) Transform custom-block HtmlBlock nodes in the AST.
  4. Render to HTML, using comrak’s syntax-highlighting plugin.
  5. (Optional) Enhance tables with responsive wrappers.
  6. (Optional) Sanitize HTML when allow_unsafe_html is false.