You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR #748 lands heading anchors for wiki-links — [[note#heading]] jumps to the matching pandoc heading id on the target page. The link side of Obsidian block references is the same syntax with a caret-prefixed anchor ([[note#^565948]]), and the permissive anchor parser added in #748 already carries the caret through to the rendered href — i.e. clicking the link will navigate to note.html#^565948. Verified by a parser-spec test.
This is a paragraph. ^blockid
- List item ^blockid
> Quoted text ^blockid
For the link to actually scroll the page, the rendered target needs id="^blockid" (or id="blockid") on the corresponding block. Today Emanote does nothing with these markers — they pass through as literal text.
Proposed approach
A pandoc filter (Haskell, parse-time) that walks blocks and:
Detects a trailing Str "^<blockid>" token (or Space, Str "^<blockid>") as the last inline of a block.
Strips the marker token from the block's inlines.
Wraps (or annotates) the block with the corresponding id attribute so anchor navigation works.
Block kinds to support: Para, the last inline of an item in OrderedList / BulletList, BlockQuote, Header. Code blocks and figure captions should likely be excluded (Obsidian itself behaves that way).
Constraints
Non-CommonMark. This is Obsidian-only — guard behind a config flag or an opt-in pandoc filter, since it changes the meaning of bare ^ in text.
ID collision. A user might write both ## Heading {#blockid} and Para ^blockid. Pick a precedence rule (probably: header attrs win, since they're explicit pandoc syntax) and document it.
Inline-position only. Obsidian's spec is "block ID at end of block." Reject mid-block markers — those are literal text.
Block embedding (![[note#^blockid]] inlining the referenced block) — depends on this issue and on the embed renderer's section-scoped TODO marked in emanote/src/Emanote/Pandoc/Renderer/Embed.hs.
Follow-up to #105 / #748.
PR #748 lands heading anchors for wiki-links —
[[note#heading]]jumps to the matching pandoc heading id on the target page. The link side of Obsidian block references is the same syntax with a caret-prefixed anchor ([[note#^565948]]), and the permissive anchor parser added in #748 already carries the caret through to the renderedhref— i.e. clicking the link will navigate tonote.html#^565948. Verified by a parser-spec test.What's missing is the definition side — Obsidian's non-CommonMark trailing-
^blockidmarker:For the link to actually scroll the page, the rendered target needs
id="^blockid"(orid="blockid") on the corresponding block. Today Emanote does nothing with these markers — they pass through as literal text.Proposed approach
A pandoc filter (Haskell, parse-time) that walks blocks and:
Str "^<blockid>"token (orSpace, Str "^<blockid>") as the last inline of a block.idattribute so anchor navigation works.Block kinds to support:
Para, the last inline of an item inOrderedList/BulletList,BlockQuote,Header. Code blocks and figure captions should likely be excluded (Obsidian itself behaves that way).Constraints
^in text.## Heading {#blockid}andPara ^blockid. Pick a precedence rule (probably: header attrs win, since they're explicit pandoc syntax) and document it.Out of scope for this issue
[[#heading]]and[[#^blockid]]— deferred in Support[[note#heading]]wiki-link anchors (discussion #105) #748, separate parser change incommonmark-wikilink(empty wikilink slug).![[note#^blockid]]inlining the referenced block) — depends on this issue and on the embed renderer's section-scoped TODO marked inemanote/src/Emanote/Pandoc/Renderer/Embed.hs.