linkcheck icon indicating copy to clipboard operation
linkcheck copied to clipboard

[BUG] Anchors are not checked after following redirects

Open stefano-ottolenghi opened this issue 1 year ago • 1 comments

Hi! I would expect that, when running with --check-anchors --show-redirects, linkcheck would emit a warning if a page has a redirect and the destination lacks the anchor (ex. a#b redirects to c, but b is not an anchor on c).

That doesn't seem to be the case.

Do we agree that this is a bug? I've seen you're swamped @filiph , and I'm happy to attempt to fix this given some starting pointers :)

stefano-ottolenghi avatar Feb 21 '24 06:02 stefano-ottolenghi

Hi @stefano-ottolenghi, thanks for the issue and yes, I'd be happy for a pull request.

I'm guessing you want to start somewhere here: https://github.com/filiph/linkcheck/blob/master/lib/src/parsers/html.dart#L100-L106

If I were you, I'd add a new test case first: https://github.com/filiph/linkcheck/tree/master/test, and try to fix it.

filiph avatar Feb 22 '24 07:02 filiph