Skip to content

T-8H57-obsidian-md-review-bug-triage

State: closed/done · Impact: high · Complexity: medium

The high-level review of obsidian-md confirmed 15 correctness bugs. Three rollout waves put the renderer in front of content the app did not author (SDLC entity bodies, agent answers, pumice admin bodies). This task triages all 15 and fixes the sanitize and routing class before those viewers ship; the rest are fixed or filed.

LocationRole today
docs/planning/backlog/B-S2FC-obsidian-md-review-findings.mdThe 15 findings, one paragraph
packages/ts/obsidian-md/src/sanitize.tsobsidianSchema allowlist; class names survive into component routing
packages/ts/obsidian-md/src/vue/render.tsComponent-override routing by tag, class and lang:
packages/ts/obsidian-md/src/vue/ObsidianMarkdown.tsHost options, resolveLink, NoteSource binding
packages/ts/obsidian-md/src/vue/components/ObsidianEmbed.tsEmbed render; drops host options and sanitize schema, swallows events
packages/ts/obsidian-md/src/vue/components/WikilinkAnchor.tsWikilink anchor; resolveLink unbound from class-based sources
packages/ts/obsidian-md/src/plugins/comments.ts%% comments; multi-paragraph and unclosed forms leak
packages/ts/obsidian-md/src/plugins/block-ids.tsBlock-id stripping deletes mid-line author text
packages/ts/obsidian-md/src/plugins/shiki.tsHighlighting drops block-reference anchors; poisoned highlighter cache
packages/ts/obsidian-md/src/plugins/wikilinks.tsTokenizes inside markdown links; inline markup in aliases
packages/ts/obsidian-md/src/plugins/tags.tsTokenizes inside markdown links
packages/ts/obsidian-md/src/plugins/embeds.tsMedia embeds render as broken images
packages/ts/obsidian-md/src/slice.tsCRLF and string-domain heading slicing diverge from the parser
packages/ts/obsidian-md/test/sanitize.test.tsSanitize regression suite
packages/ts/obsidian-md/test/vue-security.test.tsVue-side security suite
packages/ts/obsidian-md/test/vue-render.test.tsRouting and render suite
packages/ts/obsidian-md/test/slice.test.tsSlicing suite

A triage table in the PR lists all 15 findings with a class (routing, sanitize, slice, tokenize, render) and a disposition (fixed here or a backlog id). Fixed here, each with a failing-then-passing test: component routing forgeable from note-authored raw HTML (mermaid, wikilink, callout via class names), %% comments leaking when multi-paragraph or unclosed, embed renders dropping host options and the sanitize schema, escaped syntax wrongly activated, and the unbound resolveLink detaching class-based NoteSources. Findings that are small (under an hour) are fixed too; the rest get one backlog entry each via sdlc backlog create. The CRLF slicing finding is handed to T-0GV4-md-engine-line-endings-corpus.

  1. Reproduce each finding as a test in the matching test/*.test.ts file; record class and disposition in the triage table.
  2. Routing: in render.ts, route components only from nodes the pipeline produced (a provenance flag from provenance.ts), never from raw HTML class names; strip obsmd-* and routing classes from raw HTML in sanitize.ts.
  3. Sanitize: fix comments.ts for multi-paragraph and unclosed %%; make ObsidianEmbed.ts pass host options and the sanitize schema to the nested render and stop swallowing events; fix escaped-syntax activation in the affected tokenizers.
  4. Binding: bind resolveLink in ObsidianMarkdown.ts so class-based NoteSources keep this.
  5. Fix any remaining finding that is small; file the others with sdlc backlog create, linking B-S2FC-obsidian-md-review-findings.
  6. bun test and tsc --noEmit in packages/ts/obsidian-md; moon run product-workbench:check (notes is the largest consumer); moon run :check :test --affected.
LocationKindChange
packages/ts/obsidian-md/src/sanitize.tsmodifyStrip routing classes from raw HTML
packages/ts/obsidian-md/src/vue/render.tsmodifyRoute only pipeline-produced nodes
packages/ts/obsidian-md/src/vue/ObsidianMarkdown.tsmodifyBind resolveLink
packages/ts/obsidian-md/src/vue/components/ObsidianEmbed.tsmodifyForward host options and schema; stop swallowing events
packages/ts/obsidian-md/src/plugins/comments.tsmodifyMulti-paragraph and unclosed %%
packages/ts/obsidian-md/src/plugins/wikilinks.tsmodifyEscaped syntax; alias markup if small
packages/ts/obsidian-md/src/plugins/tags.tsmodifyEscaped syntax; tokenizing inside links if small
packages/ts/obsidian-md/test/sanitize.test.tsmodifyRegression tests
packages/ts/obsidian-md/test/vue-security.test.tsmodifyRegression tests
packages/ts/obsidian-md/test/vue-render.test.tsmodifyRegression tests
packages/ts/obsidian-md/test/embeds.test.tsmodifyRegression tests
docs/planning/backlog/newOne entry per deferred finding
  • AC-1: The PR body carries a 15-row triage table with class and disposition per finding.
  • AC-2: A raw-HTML div carrying class="obsmd-mermaid", an a carrying the wikilink class, and a div carrying the callout class in note text do not route to MermaidBlock, WikilinkAnchor or ObsidianCallout (tests in vue-security.test.ts).
  • AC-3: An unclosed %% and a multi-paragraph %% ... %% render none of their content (tests in sanitize.test.ts or a new comments.test.ts).
  • AC-4: An embed renders with the host’s components, resolveLink and sanitize schema and click events reach the host (test in embeds.test.ts).
  • AC-5: A class-based NoteSource whose resolveLink reads this works (test in vue-render.test.ts).
  • AC-6: bun test and tsc --noEmit pass in packages/ts/obsidian-md.
  • AC-7: Every finding not fixed here has a backlog file under docs/planning/backlog/ whose body cites B-S2FC-obsidian-md-review-findings; the triage table names each id.

Member of milestone M-931L; promoted from backlog item B-S2FC-obsidian-md-review-findings; the untrusted-content gate of D-K3EM-markdown-editor-chrome-and-plugin-environment.


← Back to Tasks