Giter Club home page Giter Club logo

Comments (20)

XhmikosR avatar XhmikosR commented on May 25, 2024 1

@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

from jekyll-toc.

mdo avatar mdo commented on May 25, 2024

This isn't the plugin's fault, it's mine. Fixed this in twbs/bootstrap@0d14fe9.

from jekyll-toc.

XhmikosR avatar XhmikosR commented on May 25, 2024

Cool, thanks!

from jekyll-toc.

XhmikosR avatar XhmikosR commented on May 25, 2024

There are many more we need to fix that only the official validator will warn ;)

from jekyll-toc.

toshimaru avatar toshimaru commented on May 25, 2024

thanks for reporting!

if any other issue or concern, please let me know!

from jekyll-toc.

XhmikosR avatar XhmikosR commented on May 25, 2024

@toshimaru: now that I looked into this closer, I do believe we could benefit from an ignore function.

Our docs use .bd-example for the examples; we basically don't want those in the TOC and this results to invalid HTML because the header hierarchy is pretty random. For example, we have an h3 before the div.bd-example, and into that div we have h6; then jekyll-toc nests that into another ul which results in invalid HTML.

from jekyll-toc.

XhmikosR avatar XhmikosR commented on May 25, 2024

@toshimaru: I still think it's wrong HTML on your plugin's side. You seem to be adding a new ul inside a ul in these lines: https://github.com/toshimaru/jekyll-toc/blob/master/lib/table_of_contents/parser.rb#L95-L101

from jekyll-toc.

toshimaru avatar toshimaru commented on May 25, 2024

@XhmikosR Thanks for sending PR! Could you give me an example to reproduce this issue?

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

This link you gave still generates invalid HTML?

from jekyll-toc.

toshimaru avatar toshimaru commented on May 25, 2024

I tried it, but I didn't get any error.

$ bootstrap git:(v4-dev) bundle exec jekyll build
Configuration file: /Users/toshimaru/src/github.com/twbs/bootstrap/_config.yml
            Source: .
       Destination: ./_gh_pages
 Incremental build: disabled. Enable with --incremental
      Generating...
                    done in 7.887 seconds.
 Auto-regeneration: disabled. Use --watch to enable.

Something I missed? @XhmikosR

Update: I've found out the invalid HTML. am looking into the cause.

from jekyll-toc.

XhmikosR avatar XhmikosR commented on May 25, 2024

from jekyll-toc.

toshimaru avatar toshimaru commented on May 25, 2024

@XhmikosR Hi, I've given it a try in #33. Can you test my branch in you local environment?

from jekyll-toc.

XhmikosR avatar XhmikosR commented on May 25, 2024

@toshimaru: confirmed, it fixes the errors. I'm gonna close my PR.

Thanks!

from jekyll-toc.

toshimaru avatar toshimaru commented on May 25, 2024

Hi, @XhmikosR I've just release v0.4.0.rc. Can you try it out and please let me know if any issues.

from jekyll-toc.

XhmikosR avatar XhmikosR commented on May 25, 2024

@toshimaru: thanks! I tested this in our html-linting branch and I still get one error there:

C:\Users\xmr\Desktop\bootstrap>npm run docs-lint

> [email protected] docs-lint C:\Users\xmr\Desktop\bootstrap
> node build/htmllint.js

"file:/C:/Users/xmr/Desktop/bootstrap/_gh_pages/docs/4.0/components/alerts/index.html":587.1-587.4: error: Element "ul" not allowed as child of element "ul" in this context. (Suppressing further errors from this subtree.)

This is the related HTML:

            <ul class="section-nav">
<li class="toc-entry toc-h2"><a href="#examples">Examples</a>
<ul>
<ul>  <!--ERROR-->
<li class="toc-entry toc-h4"><a href="#conveying-meaning-to-assistive-technologies">Conveying meaning to assistive technologies</a></li>
</ul>
<li class="toc-entry toc-h3"><a href="#link-color">Link color</a></li>
<li class="toc-entry toc-h3"><a href="#additional-content">Additional content</a>
<ul>
<li class="toc-entry toc-h4"><a href="#well-done">Well done!</a></li>
</ul>
</li>
<li class="toc-entry toc-h3"><a href="#dismissing">Dismissing</a></li>
</ul>
</li>
<li class="toc-entry toc-h2"><a href="#javascript-behavior">JavaScript behavior</a>
<ul>
<li class="toc-entry toc-h3"><a href="#triggers">Triggers</a></li>
<li class="toc-entry toc-h3"><a href="#methods">Methods</a></li>
<li class="toc-entry toc-h3"><a href="#events">Events</a></li>
</ul>
</li>
</ul>

from jekyll-toc.

XhmikosR avatar XhmikosR commented on May 25, 2024

If I change the Examples header to h2 then there is no error. I still believe this is an issue and should be handled because you can't expect people to use a specific header :)

from jekyll-toc.

toshimaru avatar toshimaru commented on May 25, 2024

hmm, I'm gonna give it another try.

Related: #20 (comment)

from jekyll-toc.

toshimaru avatar toshimaru commented on May 25, 2024

Hello, @XhmikosR , I've just released v0.4.0.rc2! Could you try again?

from jekyll-toc.

XhmikosR avatar XhmikosR commented on May 25, 2024

@toshimaru: seems to work fine now, thanks!

from jekyll-toc.

toshimaru avatar toshimaru commented on May 25, 2024

👍

thanks for your contribution!!

from jekyll-toc.

toshimaru avatar toshimaru commented on May 25, 2024

just let you know, this change is officially releases as v0.4.0

from jekyll-toc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.