-
-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non-link footnotes in markdown are reported as broken links. #1409
Comments
Oh wow, thanks for reporting. Definitely a bug. lychee/lychee-lib/src/extract/markdown.rs Line 11 in f2b1c29
|
I've added a test in #1410. Unfortunately, I can't figure out where extraction of markdown links is happening. |
Thanks. :) |
You're more than welcome. 😊 I'd have liked to give resolution a shot, but couldn't identify where to start. It's probably somewhere in the parser? If so, that's probably more than I can chew right now. |
Feel free to dive in. But yeah, it's in the markdown parser in pulldown_cmark, which is the crate we're using for it. |
I had a closer look at this. Actually this is not a bug in lychee. So the example you provide:
is understood as shortcut reference link and therefore converted into the following HTML:
When not using a valid (relative) link it is not a shortcut reference link and the text is simply understood as normal paragraphs:
So footnotes are neither part of CommonMark nor GitHub Flavored Markdown (the only Markdown specifications I know of) but still some people might be using them because many non-specified flavours do make use of them. (the beauty of the Markdown flavour swamp) So one thing we could do is to treat the link of these shortcut type links not as URL but as plain text ( |
Interesting! Thanks for digging and explaining what's going on.
I disagree: 😌
Here is a simple footnote[^1].
[^1]: My reference. Edit: Quote linked documentation directly. |
No problem 👍
Wait... |
Consider the following file
/tmp/file.md
:Running
lychee .
produces the following error[./file.md]: ✗ [ERR] file:///tmp/short | Failed: Cannot find file
To the best of my knowledge,
short
is never a link but always a footnote. It would be nice for these presumed false positives to not occur.The text was updated successfully, but these errors were encountered: