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

feature request: check text fragments #1545

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

feature request: check text fragments #1545

SKalt opened this issue Oct 26, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@SKalt
Copy link

SKalt commented Oct 26, 2024

Text fragments are a standardized way to link to webpage text without relying on HTML ID attributes. They are supported by all modern browsers. I'd like to use lychee to make sure my text fragment links are valid!

Example:

<!-- file.html -->
<html>
  <body>
    <div>
      <a href="https://developer.mozilla.org/en-US/docs/Web/URI/Fragment/Text_fragments#:~:text=without%20relying%20on%20the%20presence%20of%20IDs">
        valid
      </a>
      <a href="https://developer.mozilla.org/en-US/docs/Web/URI/Fragment/Text_fragments#:~:text=asdfawefaweafa">
        invalid
      </a>
    </div>
  </body>
</html>
; lychee --version
# lychee 0.16.1
; lychee -vv --include-fragments ./file.html
#     [200] https://developer.mozilla.org/en-US/docs/Web/URI/Fragment/Text_fragments#:~:text=without%20relying%20on%20the%20presence%20of%20IDs
#     [200] https://developer.mozilla.org/en-US/docs/Web/URI/Fragment/Text_fragments#:~:text=asdfawefaweafa

Desired behavior: if lychee is configured to check fragments and is passed a #:~:text=... fragment, lychee should throw an error if the text is not found within the linked document.

@mre
Copy link
Member

mre commented Oct 26, 2024

@HU90m, this one has your name on it. 😆

@mre mre added the enhancement New feature or request label Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants