The DOM element containing code blocks
Configure the underlying engine with the provided options.
Get the current configuration
Get the list of headings from the last parsed document Useful for building table of contents
Get list of supported Prism languages
Highlight code blocks with Prism Call this after the HTML has been inserted into the DOM
The DOM element containing code blocks
Initialize collapsible heading functionality This method is a no-op - the component handles event binding
Check if a language is supported by Prism
Parse markdown to HTML.
The markdown string to parse
Optionalconfig: Partial<MarkdownConfig>Optional config overrides for this parse operation
The rendered HTML string
Parse markdown asynchronously (useful for large documents)
Optionalconfig: Partial<MarkdownConfig>Render Mermaid diagrams in a container element Call this after the HTML has been inserted into the DOM
The DOM element containing mermaid code blocks
Reset configuration to defaults
Sanitize rendered HTML for binding to innerHTML while preserving layout HTML, inline styles and inline SVG. See the DOMPurify configuration at the top of this file for what is kept and removed. Where no DOM is available to sanitize with, the markup is escaped and rendered as text rather than trusted.
Add copy buttons to code blocks