Comments (6)
Thanks for the PR, but being we only use Jekyll for v4 I think it'd be wiser to just leave it as is. On master we switch to Hugo, I just thought this was a regression that's why I commented :)
from jekyll-toc.
issue reported by @XhmikosR.
#82 (comment)
Quote:
@toshimaru this breaks a few things, or one of the other 0.12.0 changes.
If you try our v4-dev branch from https://github.com/twbs/bootstrap.git, and switch to jekyll-toc 0.12.0, you see that even with {% toc %} we get no ToC. Also, bd-example isn't skipped anymore, at least for the alerts page I see Well Done in ToC, only this entry.
from jekyll-toc.
It happens when page content returns wrong HTML(partially markdown content).
> context.registers[:page]['content']
=> "## Examples\n\nAlerts are available for any length of text, as well as an optional dismiss button. For proper styling, use one of the eight **required** contextual classes (e.g., `.alert-success`). For inline dismissal, use the [alerts jQuery plugin](#dismissing).\n\n{% capture example %}\n{% for color in site.data.theme-colors %}\n<div class=\"alert alert-{{ color.name }}\" role=\"alert\">\n A simple {{ color.name }} alert—check it out!\n</div>{% endfor %}\n{% endcapture %}\n{% include example.html content=example %}\n\n{% include callout-warning-color-assistive-technologies.md %}\n\n### Link color\n\nUse the `.alert-link` utility class to quickly provide matching colored links within any alert.\n\n{% capture example %}\n{% for color in site.data.theme-colors %}\n<div class=\"alert alert-{{ color.name }}\" role=\"alert\">\n A simple {{ color.name }}
...
not sure why it happens.
Right behavior
Retirning HTML.
context.registers[:page]['content']
=> "<style type=\"text/css\">\n@-webkit-keyframes anim {\n 0% { opacity: 0; }\n 100% { opacity: 1; }\n}\n@keyframes anim {\n 0% { opacity: 0; }\n 100% { opacity: 1; }\n}\n.post-image {\n -ms-animation: anim 2s infinite;\n -webkit-animation: anim 2s infinite;\n animation: anim 2s infinite;\n}\n</style>\n\n<p><a href=\"http://www.adventar.org/calendars/57\">CSS Property Advent Calendar 2013</a>の11日目の記事としてCSSアニメーションのプロパティを紹介をします。</p>\n\n<h2 id=\"なぜcssアニメーションなのか\">なぜCSSアニメーションなのか?</h2>
...
from jekyll-toc.
I think it's a matter of order. With 0.12.0 you are accessing content before it's been processed by Jekyll, thus the example
shortcode hasn't run by the time jekyll-toc runs.
from jekyll-toc.
Yes, it seems so. will look into further why the order changes by a content.
from jekyll-toc.
Created PR: twbs/bootstrap#28598
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 1
- 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
- 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.