You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(and it's a smaller issue than not having a linkchecker at all, so we can fix this one separately)
The linkchecker tool we're using (https://linkchecker.github.io/linkchecker/index.html) is sufficient to detect broken internal links within the site. I.e., it will fail/report an error when a file contains a link [foo](bar.md) and bar.md does not exist. This is adequate for our initial need.
However, linkchecker does not by default detect when an anchor link (one containing a #anchor) is broken.
So while [foo](bar.md#baz) will report an error if bar.md does not exist, it does not detect when bar.md exists but contains no anchor baz.
Similarly, even intra-page links won't fail on bad anchor names. E.g., [foo](#foo) does not fail when the file we're in has no foo anchor.
In general, we probably should just avoid to the degree possible using anchor links in this way, as unless we take specific care to explicitly include <a name=anchorname></a> tags in the markdown, the default is that anchors are just header names with non-word characters replaced by -, so ## My section heading becomes #my-section-heading. But because section headings are content, we can expect them to change based on editorial requirements, which has the side effect of potentially breaking anything that was linked to #my-section-heading when the heading changes to ## My New Section Heading with a new default anchor of #my-new-section-heading.
However, as it seems likely that at least intra-page links might have their place regardless of the above, we ought to be on the lookout for a linkchecker that can do this task for us and either replace the existing one with one that can do both page links and anchor links or augment the existing checker with one that does anchor links specifically.
The text was updated successfully, but these errors were encountered:
This only becomes an issue once we merge
(and it's a smaller issue than not having a linkchecker at all, so we can fix this one separately)
The
linkchecker
tool we're using (https://linkchecker.github.io/linkchecker/index.html) is sufficient to detect broken internal links within the site. I.e., it will fail/report an error when a file contains a link[foo](bar.md)
andbar.md
does not exist. This is adequate for our initial need.However,
linkchecker
does not by default detect when an anchor link (one containing a#anchor
) is broken.So while
[foo](bar.md#baz)
will report an error ifbar.md
does not exist, it does not detect whenbar.md
exists but contains no anchorbaz
.Similarly, even intra-page links won't fail on bad anchor names. E.g.,
[foo](#foo)
does not fail when the file we're in has nofoo
anchor.In general, we probably should just avoid to the degree possible using anchor links in this way, as unless we take specific care to explicitly include
<a name=anchorname></a>
tags in the markdown, the default is that anchors are just header names with non-word characters replaced by-
, so## My section heading
becomes#my-section-heading
. But because section headings are content, we can expect them to change based on editorial requirements, which has the side effect of potentially breaking anything that was linked to#my-section-heading
when the heading changes to## My New Section Heading
with a new default anchor of#my-new-section-heading
.However, as it seems likely that at least intra-page links might have their place regardless of the above, we ought to be on the lookout for a linkchecker that can do this task for us and either replace the existing one with one that can do both page links and anchor links or augment the existing checker with one that does anchor links specifically.
The text was updated successfully, but these errors were encountered: