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

a.textContent is checked even if the text is shortened for the link #1399

Open
jpoehnelt opened this issue Apr 4, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@jpoehnelt
Copy link

jpoehnelt commented Apr 4, 2024

Is there a way to skip the check of textContent for the a tag?

<a href="https://example.com/foo/1231241243124124124">https://example.com/foo/...</a>

Originally posted by @MichaIng in #259 (comment)


While checking our forum for outdated links, I recognised that also shortened URL text within anchor tags is checked. phpBB shortens long URLs. so that such an element is produced:

<a href="https://example.com/loong/looong/url/that/is/shorteneed/index.html" class="postlink">https://example.com/loong/looong/url/th ... index.html</a>

lychee now checks the URL itself but as well the text, where it identifies https://example.com/loong/looong/url/th as URL, which of course fails.

So once a basic functionality exists to exclude URLs/text based on HTML tags, the text content of tags/elements which have an explicit src/href/... attribute could be excluded by default, as AFAIK such shortening is quite common.

@mre mre added the bug Something isn't working label Apr 4, 2024
@mre
Copy link
Member

mre commented Apr 4, 2024

Just tested this and you're right. This is a bug, and we should exclude textContent unless --include-verbatim is enabled.

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