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

fix: do not fail on empty # and #top fragments #1609

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MichaIng
Copy link
Member

@MichaIng MichaIng commented Jan 8, 2025

The empty "#" and "#top" fragments are always valid without related HTML element. Browser will scroll to the top of the page. Hence lychee must not fail on those.

Fixed #1599

@MichaIng MichaIng requested a review from mre January 8, 2025 07:05
@MichaIng MichaIng added bug Something isn't working false-positive labels Jan 8, 2025
The empty "#" and "#top" fragments are always valid without related HTML element. Browser will scroll to the top of the page. Hence lychee must not fail on those.

Signed-off-by: MichaIng <[email protected]>
@MichaIng
Copy link
Member Author

MichaIng commented Jan 8, 2025

Went with the two == first, but lint suggests is_empty(). The two test runs show the currently inconsistent results:

  1. https://github.com/lycheeverse/lychee/actions/runs/12665712696/job/35295837656
    #top in file.html succeeds, # in file.html and # + #top in file1.md fail.
  2. https://github.com/lycheeverse/lychee/actions/runs/12665772582/job/35296001037
    # in file.html succeeds, #top in file.html and # + #top in file1.md fail.

On my local tests, randomly, at least one, up to all of those failed. Would be interesting to know where this inconsistency is coming from, as I would suggest the same fragment to succeed or fail every time the same way 🤔.

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

Successfully merging this pull request may close these issues.

Always succeed empty fragment checks
1 participant