Obsidian-dialect markdown rendering
State: open/verified · Kind: module · Audience: system
Summary
Section titled “Summary”- 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/renderToHastand the Vue notes app renders the same tree through<ObsidianMarkdown>, so both see byte-identical dialect output.
Statement
Section titled “Statement”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.
What it provides
Section titled “What it provides”- 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)
Underlying implementation
Section titled “Underlying implementation”- packages/ts/obsidian-md (unified/remark/rehype pipeline + Vue 3 integration)
Locations
Section titled “Locations”packages/ts/obsidian-md/packages/ts/obsidian-md/src/index.tspackages/ts/obsidian-md/src/vue/index.tspackages/ts/obsidian-md/src/plugins/index.tspackages/ts/obsidian-md/src/shiki.ts