Link-checker failing on HTML blocks

I am trying to build a site with some internal cross-links, but I am finding myself blocked by the link-checker. It does not appear to recognise anchors which are specified in HTML blocks, even when that HTML block is being correctly incorporated into the output.

Consider for instance:

[Link to Section One](#section-one)
[Link to Section Two](#section-two)

# Section One

Section One text

<h1 id="section-two">Section Two</h1>

which fails with

Error: The anchor in the link `@/blog/first.md#section-two` in content/blog/first.md does not exist.

My actual use case is slightly more complex than this so the obvious fix (don’t use the <h1> tags!) doesn’t work. I have generated the markdown that I want zola to use with pandoc, as this can generate a formatted bibliography for me. The commonmark that it generates produces markdown links to anchors which are specified in <div> tags.

I have investigated skip-anchor-prefixes (all the anchors do have a common prefix) but I think this only works for external links.

Is this expected behaviour? It is possible to disable the link checker on certain links?

I have found Anchor not found by zola, but it works in browser, post-hoc, so obviously this is expected behaviour.

So, I am clearly not using skip_anchor_prefixes correctly. My current config.toml has

[link_checker]
# Skip anchor checking for external URLs that start with these prefixes
skip_anchor_prefixes = [
    "section",
]

In the hope that this will match “section-two” above. But the link checker is still reporting an error.

See also Build fails because of the [false] anchor validation error · Issue #1707 · getzola/zola · GitHub

We do not parse HTML in markdown so in your example zola doesn’t know about the section-two id. We should probably have a setting to disable internal anchor checking if someone uses plain HTML anchors a lot as parsing HTML to find it out it not really sustainable.