feat: parse and render Obsidian cross-references (task 0005) #4
Reference in New Issue
Block a user
Delete Branch "task-0005-cross-references"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Task:
.claude/tasks/0005-cross-references.mdSummary
Adds Obsidian cross-references as typed inline nodes and renders them.
WikilinkNodeandTransclusionNodeshare a{ target, anchor?, display? }shape and are distinct node types.[[…]]wikilinks parse viaremark-wiki-link(added to the pipeline); the#anchoris split out in the translation layer and passed through verbatim, and a display alias is captured after|.![[…]]transclusions — including Step References (#section:N,#N) — are recovered by scanning text runs, sinceremark-wiki-link@2.0.1does not recognise embeds.rendershows wikilinks underlined (display text, or the target when there is none) and transclusions as their reconstructed raw source text.Deviations
remark-wiki-link@2.0.1handles only[[…]], not![[…]]embeds, and does not split the#anchor. Transclusions are therefore recovered by a text-run scan and anchors are split by a sharedsplitAnchorhelper. The plugin's alias divider is set to|so Step Reference anchors like#rolling:2are not consumed.Full detail in the task file's
## Implementation Notes.Review
Risk
Overall: Medium
InlineNodeunion, though changes are additive and both consuming switches are updated here.Unaddressed findings
None. The Spec axis reported no blocking findings (all seven acceptance criteria met). The Standards axis's hard findings — semicolons in comments and multiple sentences per comment line — were fixed in this branch; its remaining items (two structurally identical interfaces, and a shared construction shape between
translateWikilink/buildTransclusion) were judgement calls the reviewer deemed defensible, given the repo's discriminated-union convention and the genuinely different display-derivation logic.Model `[[wikilinks]]` and `![[transclusions]]` as distinct inline node types sharing a `{ target, anchor?, display? }` shape, and render them: wikilinks underlined (display text or target), transclusions as their raw source text. remark-wiki-link is added to the pipeline for `[[…]]`. It does not recognise `![[…]]` embeds or split the `#anchor` from the target, so transclusions are recovered by scanning text runs and anchors are split in the translation layer. Its alias divider is set to `|` so Step Reference anchors like `#rolling:2` survive.