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

How should lychee treat empty-string href values? #1531

Open
SKalt opened this issue Oct 16, 2024 · 1 comment
Open

How should lychee treat empty-string href values? #1531

SKalt opened this issue Oct 16, 2024 · 1 comment

Comments

@SKalt
Copy link

SKalt commented Oct 16, 2024

Context

If I'm writing markdown

[this website]()

that gets compiled to html

<a href="">this website</a>

the href's value is the page's address. However, an empty href is also a red flag: the author probably didn't mean to leave those links empty. lychee currently interprets each empty link as a check if the current document can be reached, which it always can be.

Reproduction

mkdir -p /tmp/empty_href
echo "[this website]()" > /tmp/empty_href/example.md
echo '<html><body><a href="">this website</a></body></html>' > /tmp/empty_href/example.html
lychee -vv /tmp/empty_href/

Desired behavior

An empty_link = "warn" # or "ok" or "error" configuration option would preserve the current technically-correct link-checking behavior while giving users information about suspicious links and a way to opt into more rigorous checking.

@mre
Copy link
Member

mre commented Oct 28, 2024

I don't know how to handle that at the moment. Would love to get some more comments on this before making a decision. A little hesitant to add a configuration option for it without more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants