-
-
Notifications
You must be signed in to change notification settings - Fork 139
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
Check for broken full reference links in Markdown #456
Comments
First, this is not the correct syntax for link reference. See It should be [foo]: /url "title"
[foo] Second, we relies on But if you want to identify possible 'typo's, the job would be harder as we may need to calculate some text distances. |
Oh, I did not know about |
@lebensterben These types of links have been in Markdown since the very start (https://daringfireball.net/projects/markdown/syntax#link) and have always been supported by Github. They are in fact specified in the document you linked (https://github.github.com/gfm/#example-535). What you linked is the reference for the link definition (the @mre A warning meaning it does not cause the program to return a non-zero code? |
@norswap I suggest to change the title of this issue accordingly. |
Good point. We can actually treat it as an error. After all, the link is broken. |
Would love to see this supported https://spec.commonmark.org/0.31.2/#full-reference-link has the full variety of syntax that should/must be supported. Example of another link checker that uses In minimal testing so far, I can see that any |
Hitting this issue again in a different way: I want to use a single source of truth for all links in a dedicated page & use that in rendering the HTML from Example: <!--
This file contains all links - internal and external - used in the Book, and thus serves as the master reference link source for all files.
It needs to be postfixed on all pages:
{{#include reference/links.md:15:}}
For more info, see:
- Markdown Reference Links: https://markdownguide.offshoot.io/basic-syntax/#reference-style-links
- Including files in mdBook: https://rust-lang.github.io/mdBook/format/mdbook.html#including-files for more info
-->
[term-boundless]: ./glossary.md#boundless-market
[glossary]: ./glossary.md
[reference]: ./reference.md But none of these links are checked at all, as they are not used in the page itself, only latter at render time when they are injected into a page that requires the links |
Haven't tested it, but did you try |
Thus all reference links are omitted |
Okay, I see the problem now. Maybe we need to start by setting |
Currently lychee does not check for bad "link references" (not sure if this is the proper name), e.g.
It would be great if that was caught!
The text was updated successfully, but these errors were encountered: