Skip to content

fix: report raw url for dead links - #5316

Open
bluwy wants to merge 4 commits into
mainfrom
report-raw-dead-links
Open

fix: report raw url for dead links#5316
bluwy wants to merge 4 commits into
mainfrom
report-raw-dead-links

Conversation

@bluwy

@bluwy bluwy commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Description

With a setup like 中文.md with

[test](./报错信息.md#test)

Before:

(!) Found dead link ./%E6%8A%A5%E9%94%99%E4%BF%A1%E6%81%AF in file /Users/bjorn/Work/oss/vitepress/docs/en/中文.md:1

After:

(!) Found dead link ./报错信息.md#test in file /Users/bjorn/Work/oss/vitepress/docs/en/中文.md:1

This PR renames the linkLines property to linkMetadatas. linkLines was added in #5230 which is recent so it's likely less breaking. Ideally we could consolidate all link-related info into links as an array of objects, but maybe it's not worth breaking still.

Linked Issues

fixes #4992

Additional Context

Couple things I realized that's not related to the PR:

  1. If ignoreDeadLinks is a filter function, it looks like we pass the encoded url which probably isn't nice to use with.
  2. Link lines didn't take into account of links that are in multiple lines but part of the same paragraph, for example:
    This is a [paragraph](./a)
    and this is the next part in the [paragraph](./b)
    It'll point all links to the first line of the paragraph. I can look into fixing this separately.

Tip

The author can publish a preview release by commenting /publish after creating the PR.

Comment thread src/node/markdown/plugins/link.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] 报错信息中原封不动输出url

1 participant