Open sxlijin opened 5 months ago
I was seeing a similar issue when checking local files. I learned from other issues that -v
will include excluded links in the output; with the command-line:
lychee --include-fragments --config lychee.toml -v public/
I got e.g.:
? [EXCLUDED] file:///<working directory>/public/writing/notes/index.html#procedural | Excluded
I modified my lychee.toml
to include scheme = ["http", "https", "file"]
; with that, the same command-line covered the fragments.
This is quite counterintuitive, because I never specify file:
URLs in my source. The file public/writing/notes/index.html
contains <a href="#procedural">
-- it's Lychee that is creating the file:
scheme.
My expectation would be that, if I specify a local path, all relative links would be checked; scheme
would only apply to links that specify a scheme.
This is a summary for anyone interested in submitting a pull request to fix this issue.
lychee fails to detect missing anchors/fragments in remote URLs, even when fragment detection is explicitly enabled.
Run the following command:
echo 'https://github.com/lycheeverse/lychee#non-existent-anchor' | lychee - -vvv --include-fragments
Expected: lychee reports the missing anchor Actual: lychee reports the link as OK:
✔ [200] https://github.com/lycheeverse/lychee#non-existent-anchor
🔍 1 Total (in 0s) ✅ 1 OK 🚫 0 Errors
Update lychee to properly check and report missing anchors/fragments when parsing remote URLs when --include-fragments
is used.
When checking https://docs.boundaryml.com, muffet detects when an anchor doesn't exist
but lychee does not, even with fragment detection explicitly specified (presumably it's on by default):