bootstrap-toc icon indicating copy to clipboard operation
bootstrap-toc copied to clipboard

Fix toc with one element

Open sasanikolic90 opened this issue 5 years ago • 1 comments

The TOC structure is wrongly built when there is only one heading in the toc scope. I think the second ul tag is not necessary.

toc-one-heading-issue

That is caused by getTopLevel() function, that in this case returns 1 as the top level.

sasanikolic90 avatar Feb 19 '19 17:02 sasanikolic90

Created a PR here: https://github.com/afeld/bootstrap-toc/pull/55

Not sure if this is actually correct, since I changed some core functionality here. In fact, I totally opted out h1 titles and made the top level default to 2. This fixes the issue.

sasanikolic90 avatar Feb 19 '19 18:02 sasanikolic90