Repository navigation
fix: name the document a refused Markdown link was authored in - #94
Closed
glennmichael123 wants to merge 1 commit into
Closed
glennmichael123 wants to merge 1 commit into
glennmichael123 wants to merge 1 commit into
Conversation
Both link failures named the destination and nothing else, which is the half the reader already knows: the destination is what is missing, and the file holding the link is what has to be edited. On a docs set of any size the only way to act on the message was to grep for the string. The throw site already had the answer. `resolveLink` reads `page.sourceFile` on the line above, to resolve the destination it then rejects, so this is the path relative to the documentation root rather than anything newly threaded through. Under an include it names the included file rather than its host, because `rewriteMarkdownSourceLinks` hands `resolveLink` the innermost origin on its stack. That is the file somebody has to open, and the two differ exactly when the message matters most. Closes #92.
✅ Deploy Preview for bunpress ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Member
Author
glennmichael123
deleted the
fix/name-the-document-a-refused-link-is-in
branch
October 26, 2026 13:55
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.
Closes #92.
What changed
Both link failures in
resolveLinknamed the destination and nothing else:The destination is the half the reader already knows, because it is the part that is
missing. The file holding the link is what has to be edited, and it was not in the
message, so acting on it meant grepping the repository for the string.
The throw site already had the answer.
resolveLinkreadspage.sourceFileon the lineabove, to resolve the destination it then rejects, so nothing new is threaded through:
Relative to the documentation root, because an absolute temporary path is noise in a
build log. The same applies to
Markdown link has no rendered page, which had the sameshape.
Includes
Named file is the included one rather than its host.
rewriteMarkdownSourceLinkshandsresolveLinkthe innermost origin on its include stack, sopage.sourceFileis alreadywhere the link was written. The two differ exactly when the message matters most, so
there is a test for it.
Tests
Two, in
test/markdown-source-links.test.tsbeside the existing coverage for this area.Both were run against the unpatched source first and fail there:
Full suite: 612 pass, 0 fail. Lint is unchanged at 3 pre-existing warnings in
README.mdand
serve.ts, identical before and after.tsc --noEmitis clean.Not in this change
#93, the build stopping at the first unresolvable link so N of them cost N builds. That
one needs failures collected across the render and reported together, which is a larger
change than this message fix and is better judged on its own.
🤖 Generated with Claude Code