Skip to content

Obsidian-dialect markdown rendering

State: open/verified · Kind: module · Audience: system

  • Renders Obsidian-dialect markdown (wikilinks, embeds, callouts, tags, block ids, highlights, math, mermaid) to sanitized HTML/hast via a remark/rehype pipeline, plus a Vue 3 component layer over the same tree.
  • One shared rendering plane: build-time consumers (Astro, static export) call renderToHtml/renderToHast and the Vue notes app renders the same tree through <ObsidianMarkdown>, so both see byte-identical dialect output.

The package parses CommonMark/GFM plus a full Obsidian dialect strictly as remark/rehype plugins over the standard mdast/hast pipeline (design constraint D-7VMX: no bespoke parser). It produces sanitized HTML, a raw hast tree, or (via the Vue subpath) an interactive component tree with pluggable link/tag/embed/table/code-block chrome. Link and embed resolution, and asset URLs, are always injected by the host — the renderer never touches a filesystem, index, or router.

  • renderToHtml / renderToHast / renderToHtmlSync entry points and extractOutline for source-mapped heading outlines
  • Vue 3 <ObsidianMarkdown> component with overridable node routing (wikilink, tag, callout, embed, code fence, table) and a --obsmd-* theme.css contract
  • Framework-free math (KaTeX) and mermaid rendering helpers usable outside Vue, and opt-in Shiki syntax highlighting via a separate subpath
  • obsidianSchema: a rehype-sanitize allowlist hardened against script injection and routing-signal spoofing (className/id namespacing, pipeline-only elements)
  • packages/ts/obsidian-md (unified/remark/rehype pipeline + Vue 3 integration)
  • packages/ts/obsidian-md/
  • packages/ts/obsidian-md/src/index.ts
  • packages/ts/obsidian-md/src/vue/index.ts
  • packages/ts/obsidian-md/src/plugins/index.ts
  • packages/ts/obsidian-md/src/shiki.ts

← Back to Capabilities