I think as you've observed, the issue is with the mismatch in that the URL does encoding of the fragment identifier, but there is no encoding done in the id
attribute of the HTML for the heading. Since the encoding is necessary for the URL representation, I believe that we would also need to do this encoding for the attribute as well so that they match up, even though it isn't technically required to be encoded in the HTML.
Specifically, there are 2 places in the JSON that are relevant here:
- A
url
value in areferences
item, representing the link to the subsection - An
anchor
value in the section data for the heading, representing the id attribute
To fix this, I believe we would want to update DocC to also do the URL encoding for the anchor
values (2) in addition to the URLs (1).
Technically, we could do this in the renderer, but I think it makes sense for DocC to handle this since it is already generating this data.