lychee icon indicating copy to clipboard operation
lychee copied to clipboard

Weird/incorrect behaviour when checking local links

Open fenuks opened this issue 5 months ago • 0 comments

I'm using lychee 0.15.1 on Arch Linux.

Here is an example markdown document:

# Incorrect or strange behaviour
## Links not being checked
- [ ] [Test1](~/Downloads/not checked because of space)
- [ ] [Test3](/home/nonsense/not-checked2-absolute-path)

## Links checking not working because of tilde
- [Test4](~/incorrect-check)
<!-- ✗ [ERR] file:///home/me/Documents/~/incorrect-check | Failed: Cannot find file -->

# Links checked correctly
- [Test5](./correct-check)
<!-- ✗ [ERR] file:///home/me/Documents/correct-check | Failed: Cannot find file -->
$ lychee test.md 
  2/2 ━━━━━━━━━━━━━━━━━━━━ Finished extracting links                                                             Issues found in 1 input. Find details below.

[test.md]:
✗ [ERR] file:///home/fenuks/Dokumenty/notatki/correct-check | Failed: Cannot find file
✗ [ERR] file:///home/fenuks/Dokumenty/notatki/~/incorrect-check | Failed: Cannot find file

🔍 2 Total (in 0s) ✅ 0 OK 🚫 2 Errors

It seems that lychee skips links with absolute path or spaces, and it doesn't handle links with ~ as absolute links.

fenuks avatar Sep 21 '24 12:09 fenuks