DavidAnson / check-pages

Checks various aspects of a web page for correctness.
MIT License
11 stars 6 forks source link

feature_request(checkLinks): check if fragment identifier exists #10

Open Kristinita opened 3 years ago

Kristinita commented 3 years ago

1. Summary

It would be nice, if check-pages will check, if correct URI fragment exists.

2. MCVE

For example, I have correct URL "http://localhost:4147/path/to#KiraGod":

<a id="KiraGod"></a>

On another page, I make an incorrect link to the fragment identifier, example:

<a href="../path/to#KiraGo">KiraGod</a>

File to.html has an anchor #KiraGod, but not #KiraGo; I make a typo.

It would be nice, if check-pages will check similar typos.

3. Argumentation

3.1. Headers

Me or maintainers of third-party sites can:

  1. Make typos as in example above;
  2. Modify or delete headers.

And site visitors may navigate to incorrect anchors.

3.2. Lack of available checkers/linter/validators

For me this is a common problem, but I haven’t found any tools that can solve it. Examples:

  1. grunt-link-checker works with links poorly. It cannot be used for real web-sites.
  2. remark-validate-links and link-checker not implemented this feature.

Thanks.

Kristinita commented 2 years ago

@DavidAnson, this issue is still relevant as of September 2022.

Thanks.

Kristinita commented 7 months ago

This issue is still relevant as of January 2024.

LinkСhecker plugin “AnchorCheck” supports requested feature, but it’s extremely slow. Without “AnchorCheck” LinkChecker checks all the links of my real project in 3 minutes, with “AnchorCheck” — in an hour and a half.

Thanks.