Member Junction
    Preparing search index...

    Framework-agnostic markdown engine.

    Owns the marked configuration and the MemberJunction custom extensions (SVG code blocks, collapsible headings, GitHub alerts, heading ids, smartypants). It produces either:

    • an HTML string via parseToHtml — consumed by the Angular ng-markdown component (which then does its DOM post-processing), or
    • a token tree (AST) via parseToTokens — consumed by the React Native renderer (and any other non-DOM target).

    The engine has no DOM, Prism, or Mermaid dependency. Highlighting is injected by the caller; Mermaid and copy-button wiring are the host's responsibility.

    Index

    Constructors

    Methods

    • (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.

      Parameters

      Returns void

    • 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.

      Parameters

      • markdown: string

        The markdown string to parse

      • Optionalconfig: Partial<MarkdownConfig>

        Optional config overrides for this parse operation

      Returns string

      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.

      Parameters

      • markdown: string

        The markdown string to tokenize

      • Optionalconfig: Partial<MarkdownConfig>

        Optional config overrides for this parse operation

      Returns TokensList

      The marked token list