Add copy buttons to code blocks
The DOM element containing code blocks
Configure the underlying engine with the provided options.
Use GetConfig.
Get the current configuration
Use GetHeadingList.
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
Optionalconfig: Partial<MarkdownConfig>Use ParseAsync.
Parse markdown asynchronously (useful for large documents)
Optionalconfig: Partial<MarkdownConfig>Typeset TeX math in a container: every code.mj-math placeholder that markdown-core's
math extension emitted. Call this after the HTML has been inserted into the DOM. MathML that
arrived as markup is already rendered by the browser; it only gets the letter fix below.
The output is MathML, which current browsers lay out natively, so hosts need no KaTeX
stylesheet or fonts. KaTeX builds the nodes itself from the TeX text (no HTML string is
parsed) and runs with trust off, so \href, \url and \includegraphics stay inert.
A formula KaTeX cannot parse, one that defines macros, or an engine that fails to load leaves
the TeX source showing as code. User sizes are capped at 20em.
Whether math is on is the caller's decision (<mj-markdown> checks its EnableMath input):
this service is a root singleton whose config the last-rendered component set, so it is no
guide to the container in hand. Without math enabled at parse time there are no placeholders.
The DOM element containing the math placeholders
true if at least one TeX formula was typeset
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
Use ResetConfig.
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.
Spell MathML's styled letters (mathvariant="bold", "double-struck", ...) with their Unicode
math characters, which Chrome renders. RenderMath already does this; call it on its own when
math is off, because MathML that arrived as markup still renders then.
The DOM element containing the MathML
Deprecated
Use AddCodeCopyButtons.