Skip to content
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

Treats markdown link text as URL #1579

Open
dbr opened this issue Dec 6, 2024 · 1 comment
Open

Treats markdown link text as URL #1579

dbr opened this issue Dec 6, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@dbr
Copy link

dbr commented Dec 6, 2024

If I have a markdown where the link text is a broken link, but the actual link target is a valid URL,

$ cat test.md 
[https://dummyexample.gov/notexist (archive.org link)](https://web.archive.org/web/20241129184733/http://example.com)

I would expect it only checks the web.archive.org link, but it checks both the link-text and the URL

$ lychee -v test.md 
   [ERROR] https://dummyexample.gov/notexist
     [200] https://web.archive.org/web/20241129184733/http://example.com

Issues found in 1 input. Find details below.

[test.md]:
   [ERROR] https://dummyexample.gov/notexist

🔍 2 Total (in 2s) ✅ 1 OK 🚫 1 Error

This seems to relate to #949 (comment) except this is a slightly different case (as a markdown parser might helpfully convert http://example.com to <a href="example.com">http://example.com</a> - but it would surely be nonsensical to ever do the same for dummyexample.gov in the initial example - it would be a link inside a link)

@dbr dbr changed the title Treats link text as URL Treats markdown link text as URL Dec 6, 2024
@mre mre added the bug Something isn't working label Dec 10, 2024
@mre
Copy link
Member

mre commented Dec 10, 2024

Yeah, we started treating plaintext links in HTML files as false-positives in #1528. Something similar could work for Markdown files.

@markogalevski fyi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants