Skip to content

linkchecker misreports target of broken link fragment #86144

Closed

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.

Activity

  1. added
    T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
    on Jun 8, 2021
  2. ehuss commented on Jun 8, 2021

    @ehuss
    Contributor

    Ah, sorry about that, I'll post a quick fix.

  3. self-assigned this
    on Jun 8, 2021
  4. added 2 commits that reference this issue on Jun 21, 2021
    63e1fd2
    e435e32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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