-
-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
{:no_toc} on highest level heading results in unrendered markup #35
Comments
You're welcome! Glad this has been able to help you out 😄 Check out to see if #36 fixes this bug for you. |
I can confirm that #36 fixes the bug as i described it - so that's a clear improvement as it doesn't break in such cases anymore. However it leads to another potential problem or unwanted user scenario. Maybe my fault, as i'm afraid i was too generic in my issue description. The page i actually discovered this problem is structured like
So with the fix, the other header (that's cool to show) will be embezzled in the TOC (meaning it only lists 3rd level headings and omits the 2nd level completely) - effectively it's as if i had included it with My feeling is the standard behaviour should still list all TOC entries and not automagically hide anything on a higher level than the first heading encountered that doesn't have a |
Given your snippet, this is how the following document structure would look like according to the TOC, which really doesn't make sense.
To me, it doesn't make sense that I think if any logic were added to handle this situation, it'd be to modify the
Completely skip the "Subheading A" section since it doesn't have a parent and I don't feel like it makes sense to promote its level. |
Having rethought this - #36 really is a good merge as it fixes the issue at hand. I'd redraw my statement on opening up the pandora's box b/c #36 makes What we're discussing now is a. basically a different discussion and b. might either lead to a breaking change or otherwise create inconsistent behaviour between having So i'd be really satisfied seeing #36 go in and leave the aforementioned discussion up to another issue. |
I agree; this should be left for another issue to get feedback from more users on the behavior and see if anyone even wants that behavior. In the meanwhile, I've tagged v1.0.12 🎉 |
My Markdown
TOC Usage
I'm including
toc.html
in a file called_includes/sidebar.html
, which in turn is included in the main_layouts
with the standard option:Expected TOC
Actual TOC
Could also reproduce this starting with a first-level header. So the general level does not matter, trying to hide the first (higher-than-the-following) heading makes it break. Also it does not break when hiding the first header when the following ones are on the same level.
Otherwise - thanks for this awesome liquid Kung Fu. It's a real life-saver as the
{:toc}
-Tag simply won't work for me outside of the main content files, whiletoc.html
does it out-of-the-box 😄The text was updated successfully, but these errors were encountered: