Table of Contents menu shows links to headings within a collapsed <details> #7265
Closed
7 tasks done
Labels
bug
An error in the Docusaurus core causing instability or issues with its execution
closed: duplicate
This issue or pull request already exists in another issue or pull request
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
The generated tables of contents (ToC) for a markdown page includes headings inside collapsed
<details>
. Clicking the ToC link does nothing.This was mentioned back in #5790. I haven't found anything in the [HTML5 spec](https://html.spec.whatwg.org/#the-details-element section on
<details>
) about disallowing heading content inside it. Some online sites such as https://a11ysupport.io/tech/html/summary_element reference them being allowed. https://stackoverflow.com/questions/49594772/should-i-specify-h2-h6-sub-headings-for-a-details-tag-to-make-the-details-a-dist#:~:text=Headings%20within%20details,)%2C%20provide%20heading%20elements%20within even references it being preferred (though I again can't find a source).See the typescript-eslint site and PR referenced in this issue for an example of where I'd want this. Specifically, I wanted to include headings inside a details view because there's a lot of content that could benefit from having sections. The details content isn't something most page readers need, though, so I didn't want to have the reading journey on the page include it so early.
member-ordering._.TypeScript.ESLint.-.Google.Chrome.2022-04-29.09-11-02.mp4
Reproducible demo
https://j2rm6f.sse.codesandbox.io/markdown-page
Steps to reproduce
<details>
element to a markdown page## ...
heading inside that details elementExpected behavior
I would think one of the two would happen:
<details>
element<details>
#5790 is related
Actual behavior
The ToC includes headings inside collapsed
<details>
. Clicking the ToC link does nothing.Your environment
Self-service
The text was updated successfully, but these errors were encountered: