B-VN2M-obsidian-md-embed-alias-markup
State: promoted/task
Found while fixing B-S2FC-obsidian-md-review-findings finding #11, “Inline markup in an alias
splits the text node — the *key* idea renders literally”, in
T-8H57-obsidian-md-review-bug-triage.
remarkWikilinks now handles a … whose delimiters straddle sibling nodes, so
the *key* idea renders the emphasis inside the anchor. remarkEmbeds has the identical
blind spot and was not changed: EMBED_RE scans one text node at a time, remark has already
turned *embedded* into an emphasis node, and no single text node holds both and. So
Note renders as literal text instead of becoming an
<obsidian-embed>.
The fix is remarkEmbeds growing the same straddling second pass remarkWikilinks has — with the
extra care that an embed’s display alias is a size hint when it is numeric (img.png),
so a straddling scan must not read markup where a size was meant.
Pinned by packages/ts/obsidian-md/test/wikilinks.test.ts, “an embed with a markup alias is left
for remarkEmbeds”, which today only asserts it does not become a wikilink anchor.