Skip to content

fix(render): locate empty-alt images by their own source span - #183

Merged
bketelsen merged 2 commits into
mainfrom
fix/render-image-source-span
Nov 11, 2026
Merged

bketelsen merged 2 commits into
mainfrom
fix/render-image-source-span

Conversation

@bketelsen

@bketelsen bketelsen commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Locate an empty-alt inline image at Goldmark's recorded source position. Reference images no longer search ahead for a matching destination, so two adjacent reference images cannot claim and rewrite a marker inside a later code span.

Closes #173.

Risk tier

Risk tier: 2 — Markdown rendering behavior. No matched risk paths; default L3. The change removes source searching and only rewrites the parsed image's own inline destination. References stay untouched.

Verification

  • mise exec -- make check passed in the isolated worktree.
  • go test ./internal/render passed, including adjacent reference images followed by a code span and a genuine inline image.
  • Revert test: restoring the old markdown.go makes TestAdjacentReferenceImagesCannotRewriteCode fail during go test ./internal/render.
  • The sweep's make vault-it passed all four kill/restart scenarios; this change does not touch vault parsing or writes.

Merge order

Stacked on #182; merge that PR first, then retarget this PR to main. Preserve ancestry with merge commits, or rebase the remaining branches after a squash merge. Full order: #181 → #182 → #183 → #184 → #185 → #186 → #188 → #187 → #189 → #190.
The final branch contains the combined fixes. CI and Flatpak workflows were dispatched on that branch because PR CI is restricted to a main base.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

level:L1 Read every line risk:high Touches a path in .github/risk-paths.json

Projects

None yet

Development

Successfully merging this pull request may close these issues.

render: an image with no alt text can still claim a marker in a later code span

1 participant