(Re)build the internal marked instance from the given configuration.
Each call constructs a fresh Marked instance and re-applies the full
extension chain in a fixed order (html-block-repair → svg → highlight →
heading ids → alerts → collapsible headings → smartypants). Ordering matters:
the SVG renderer must run before the highlighter so svg fences are not
highlighted as code.
The injected highlight function is sticky: it is only replaced when
options.highlightFn is explicitly provided. This lets parseToHtml/
parseToTokens apply per-call config overrides (which re-invoke this method
without options) without dropping the highlighter the host wired up once.
Markdown configuration; merged over DEFAULT_MARKDOWN_CONFIG.
Optionaloptions: ConfigureMarkedOptionsEngine options, e.g. an injected HighlightFunction.
Get the current resolved configuration.
Get the list of headings from the last HTML parse. Useful for building a table of contents.
Parse markdown to an HTML string.
This is the web output path. Note it does NOT perform the DOM-based
unwrapMiscodedHtml fixup that the Angular service applies afterward —
that step requires a real DOM and stays in the host.
The markdown string to parse
Optionalconfig: Partial<MarkdownConfig>Optional config overrides for this parse operation
The rendered HTML string
Parse markdown to a token tree (AST).
This is the framework-agnostic path consumed by non-DOM renderers (React
Native, etc.). Custom block tokenizers (e.g. svgCodeBlock) are applied,
but render-time hooks (highlight markup, collapsible HTML wrapping) are
NOT — the renderer decides how to present each token.
The markdown string to tokenize
Optionalconfig: Partial<MarkdownConfig>Optional config overrides for this parse operation
The marked token list
Reset configuration to defaults (keeps any injected highlight function).
Framework-agnostic markdown engine.
Owns the
markedconfiguration and the MemberJunction custom extensions (SVG code blocks, collapsible headings, GitHub alerts, heading ids, smartypants). It produces either:ng-markdowncomponent (which then does its DOM post-processing), orThe engine has no DOM, Prism, or Mermaid dependency. Highlighting is injected by the caller; Mermaid and copy-button wiring are the host's responsibility.