Closed
Description
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 to
b.html``
Actual output:
a.html:3: broken link fragment
#somethingpointing to
a.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.