Comments (20)
@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.
This isn't the plugin's fault, it's mine. Fixed this in twbs/bootstrap@0d14fe9.
from jekyll-toc.
Cool, thanks!
from jekyll-toc.
There are many more we need to fix that only the official validator will warn ;)
from jekyll-toc.
thanks for reporting!
if any other issue or concern, please let me know!
from jekyll-toc.
@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.
@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.
@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.
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.
from jekyll-toc.
@XhmikosR Hi, I've given it a try in #33. Can you test my branch in you local environment?
from jekyll-toc.
@toshimaru: confirmed, it fixes the errors. I'm gonna close my PR.
Thanks!
from jekyll-toc.
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.
@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.
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.
hmm, I'm gonna give it another try.
Related: #20 (comment)
from jekyll-toc.
Hello, @XhmikosR , I've just released v0.4.0.rc2! Could you try again?
from jekyll-toc.
@toshimaru: seems to work fine now, thanks!
from jekyll-toc.
👍
thanks for your contribution!!
from jekyll-toc.
just let you know, this change is officially releases as v0.4.0
from jekyll-toc.
Related Issues (20)
- Drop Ruby 2.4 & Jekyll 3.8
- Error when using v0.17.0 with jekyll/jekyll:3.8 Dockerfile
- Error in nokogumbo when using Ruby 2.7.0
- Feature Request: Add link_class configuration option HOT 2
- Installed following the docs, but doesn't work at all HOT 5
- [Help] - TOC level change for a specific post HOT 1
- How can I use the nav tag instead of the ul class? HOT 1
- Is Github Pages not supported? HOT 3
- Add multiple item_class classes
- Add flag to check if toc is empty HOT 2
- How to adjust the size of toc
- Faliure to generate TOC if the page contains <h1> in a code fence
- Wrong page titles in combination with jekyll-datapage-generator HOT 1
- Custom attributes on generated toc elements
- rake test fails with ruby3.2 HOT 1
- Functionality requests that anchors should be more fine-grained module designs HOT 1
- The function `generate_toc_id` isn't setup for unicode HOT 1
- Generates TOC for wrong page HOT 1
- `inject_anchors` generates empty links
- Headers are not given id attributes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jekyll-toc.