Explicit Heading for H1 not rendered in DOM #5036
Labels
bug
An error in the Docusaurus core causing instability or issues with its execution
closed: working as intended
This issue is intended behavior, there's no need to take any action.
🐛 Bug Report
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
Links to H1 Explicit Anchors are not working as they are not represented in the DOM.
Therefore the scrollbar of the browser does not jump to the desired position.
Have you read the Contributing Guidelines on issues?
Yes
Steps to reproduce
You can directly try this out in the following CodeSandbox.
https://codesandbox.io/s/fervent-pine-nbnnl?file=/docs/intro.md
Expected behavior
I would expect that the explicit heading ID is interpreted in the DOM so that by refering to a H1 heading that the scrollbar jumps to that position.
Actual behavior
The scrollbar does not jump to the heading.
See video:
2021-06-22_16h21_21.mp4
Your environment
Reproducible demo
https://codesandbox.io/s/fervent-pine-nbnnl?file=/docs/intro.md
HOW TO SOLVE:
I could solve this in theory by referencing in my markdown file to the file itself without the explicit ID.
However, my markdown is generated through a conversion from pandoc to markdown. At this stage I do not disinguis between H1, H2, H3, H4 etc.. therefore it would be difficult for me to suddenly introduce logic to detect if this is a H1 heading and then refer to the page instead of the explicit heading ID of that document.
The text was updated successfully, but these errors were encountered: