jekyll-toc: Invalid HTML

Hey, there.

So, in Bootstrap v4-dev we switched to your plugin.

I notice that the generated HTML is invalid.

See for example https://github.com/twbs/bootstrap/blob/v4-dev/docs/4.0/about/brand.md

The HTML we get is the following, which is invalid:

            <ul class="section-nav">
<ul>
<li class="toc-entry toc-h2"><a href="#contents">Contents</a></li>
<li class="toc-entry toc-h2"><a href="#mark-and-logo">Mark and logo</a></li>
</ul>
<li class="toc-entry toc-h1"><a href="#bootstrap">Bootstrap</a></li>
<li class="toc-entry toc-h1"><a href="#bootstrap-1">Bootstrap</a>
<ul>
<li class="toc-entry toc-h2"><a href="#download-mark">Download mark</a></li>
<li class="toc-entry toc-h2"><a href="#name">Name</a>
<ul>
<li class="toc-entry toc-h3"><a href="#bootstrap-2">Bootstrap</a></li>
<li class="toc-entry toc-h3"><a href="#bootstrap-3">BootStrap</a></li>
<li class="toc-entry toc-h3"><a href="#twitter-bootstrap">Twitter Bootstrap</a></li>
</ul>
</li>
<li class="toc-entry toc-h2"><a href="#colors">Colors</a></li>
</ul>
</li>
</ul>

/CC @mdo @johann-S

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 20 (19 by maintainers)

Commits related to this issue

Most upvoted comments

@toshimaru: check out the repo, and do bundle i && bundle exec jekyll build.

Without #32: https://gist.github.com/XhmikosR/9e417efb51b3b7b86c8502c8bb36b7a0 With #32: https://gist.github.com/XhmikosR/1980d50634271f3dccad173306c5b3ef

The error: Element "ul" not allowed as child of element "ul" in this context. (Suppressing further errors from this subtree.) errors are gone now.

The other errors we mostly ignore them, see https://github.com/twbs/bootstrap/pull/24149/files#diff-7f8dad109094fdde3ef01e0643325072R21