Heading not generated in `toc` if nested within 2 or more elements (but generated if nested within 1 element)
See original GitHub issueVersion
@nuxt/content: v1.14.0 nuxt: v2.15.7
Steps to reproduce
<!-- This generates Heading in TOC → -->
<div>
### Heading
</div>
<!-- This DOES NOT generate Heading in TOC → -->
<div>
<div>
### Heading
</div>
</div>
<!-- This DOES NOT generate Heading in TOC → -->
<details>
<summary>
### Heading
</summary>
Some content here
</details>
What is Expected?
-
Headings should be generated even if present inside some random Divs or at least if present inside
summary
tag. This is very common use-case while adding FAQs. -
Or, at least an option should be given in
nuxt.config.js
incontent
as to the depth/nesting of the elements up to which Headings will be generated even if written in them
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6
Top Results From Across the Web
Automatically generate nested table of contents based on ...
Have a look at the TOC class. It allows generating table of contents from nested headings. h1 tag can be followed by any...
Read more >DITA: Nested subheadings and the concept element
Approach #2: Nested concepts Another approach to writing for heading level 3 sections is to nest concept elements within concept elements.
Read more >4.4 Sections — HTML5 - W3C
The outline for a sectioning content element or a sectioning root element consists of a list of one or more potentially nested sections....
Read more >Tables of contents (TOC) - Sagehill Enterprises
The DocBook XSL stylesheets use the generate.toc parameter to determine which elements have a TOC generated at the beginning of the element in...
Read more >Video: Advanced tables of contents - Microsoft Support
By default, Word builds TOCs from text formatted with built-in heading styles. But you ... Select the text that we want to appear...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ManasMadrecha
Actually, I can’t because I’m just a collaborator. All I can do is to submit PRs like other people in community.
Additionally, I believe the maintainer also won’t do that instantly because it’s basically a breaking change.
Generally, once software reaches to v1, and the more people start to use it, maintainer has to take the more factors into consideration, such as balancing between what to do and what not to, maintainability, performance, and impacts of changes on the existing users and their projects, and so on.
In summary, for the time being, you can utilize patch-package to modify the package code only in your project.
They may handle your concern in Nuxt Content v2 or Docus since I notified them in the comment above.
I hope this would help.
A little correction:
Docus doesn’t completely replace Nuxt Content, as far as I know. So what’s described in this issue may be in the scope of Nuxt Content v2.