linkchecker: Fix bug where fragment errors printed the wrong path.

This commit is contained in:
Eric Huss 2021-06-08 17:12:48 -07:00
parent dbc8a1c25a
commit 1e9f0b367e
2 changed files with 3 additions and 2 deletions

View file

@ -347,7 +347,7 @@ impl Checker {
} else {
report.errors += 1;
print!("{}:{}: broken link fragment ", pretty_path, i + 1);
println!("`#{}` pointing to `{}`", fragment, pretty_path);
println!("`#{}` pointing to `{}`", fragment, target_pretty_path);
};
}
});

View file

@ -82,7 +82,8 @@ fn broken_fragment_local() {
fn broken_fragment_remote() {
broken_test(
"broken_fragment_remote/inner",
"foo.html:3: broken link fragment `#somefrag` pointing to `foo.html`",
"foo.html:3: broken link fragment `#somefrag` pointing to \
`[..]/broken_fragment_remote/bar.html`",
);
}