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
Resulting HTML uses the wrong id for all h2 elements. Instead of deriving the anchor id from the rendered text, the JavaScript expression repo-name is used:
<div><h1id="repositories" tabindex="-1">Repositories <aclass="header-anchor" href="#repositories"
aria-label="Permalink to "Repositories""></a></h1><h2id="repo-name" tabindex="-1">Client <aclass="header-anchor" href="#repo-name"
aria-label="Permalink to "{{ repo.name }}""></a></h2><h2id="repo-name" tabindex="-1">Server <aclass="header-anchor" href="#repo-name"
aria-label="Permalink to "{{ repo.name }}""></a></h2><h2id="repo-name" tabindex="-1">Socket <aclass="header-anchor" href="#repo-name"
aria-label="Permalink to "{{ repo.name }}""></a></h2></div>
This also seems to cause problems with hydration, probably because the ids are not unique.
Inferring IDs from dynamic content is not possible while converting markdown to vue. You'll need to do something like #960 (comment) (update it to add aria-label, etc.)
If it is not possible, then maybe it would be helpful to print a warning during build that it is not possible. The resulting page does not work properly due to problems with hydration. Would be great to catch that during build.
Describe the bug
Generating the page structure from data is incorrect if the level of h2 headers has to be generated:
Resulting HTML uses the wrong
id
for allh2
elements. Instead of deriving the anchor id from the rendered text, the JavaScript expressionrepo-name
is used:This also seems to cause problems with hydration, probably because the ids are not unique.
Reproduction
See https://stackblitz.com/edit/vite-avxyva?file=docs%2Fexample.md
Expected behavior
The 'id' for each 'h2' element is generated properly from the actual text content:
System Info
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: