Skip to content

linkchecker misreports target of broken link fragment #86144

Closed
@jsha

Description

@jsha

Steps to reproduce:

mkdir /tmp/links
cat <<EOF > /tmp/links/a.html
<div id="something">
  <a href="#something">
  <a href="b.html#something">
</div>
EOF
cat <<EOF > /tmp/links/b.html
<div id="else">
  <a href="#else">
</div>
EOF

./build/x86_64-unknown-linux-gnu/stage0-tools-bin/linkchecker /tmp/links/

Expected output:

a.html:3: broken link fragment #somethingpointing tob.html``

Actual output:

a.html:3: broken link fragment #somethingpointing toa.html``

(the difference: "pointing to a.html" vs "pointing to b.html")

This problem manifests specifically when a given file has an anchor with the same name as an anchor in a different file, and the anchor in the other file is missing.

I ran into this in practice #85970 and it sent me in a wrong debugging direction for a little while.

Metadata

Metadata

Assignees

Labels

T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions