question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Heading not generated in `toc` if nested within 2 or more elements (but generated if nested within 1 element)

See original GitHub issue

Version

@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?

  1. 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.

  2. Or, at least an option should be given in nuxt.config.js in content as to the depth/nesting of the elements up to which Headings will be generated even if written in them

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

1reaction
NozomuIkutacommented, Jan 6, 2022

@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.

1reaction
NozomuIkutacommented, Jan 5, 2022

A little correction:

Nuxt Content, which is not actively developed and is supposed to be replaced with Docus

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found