Repository navigation
fix(render): locate empty-alt images by their own source span - #183
Merged
Merged
Conversation
This was referenced Nov 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 checkpassed in the isolated worktree.go test ./internal/renderpassed, including adjacent reference images followed by a code span and a genuine inline image.markdown.gomakesTestAdjacentReferenceImagesCannotRewriteCodefail duringgo test ./internal/render.make vault-itpassed 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
mainbase.