Excluding “:not()” pseudo classes from toc list item #91
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
All selector classes are inserted as classes on the generated list item. For example, if the toc container looks like this:
<div class="toc" data-toc="h2, first-class, second class" data-toc-container=".main">
then the resulting list item will look like this:
<li class="toc-li-0 toc-h2 first-class second-class" data-scroll-init="true"><a href="#toc-1" data-smooth-active="true">Title for first list item</a></li>
This seems reasonable since there's a possibility that you might want to style list items differently based on their sources.
But if you use something like:
data-toc="h2:not(.excluded-class)"
then you'll get:
<li class="toc-li-0 toc-h2 excluded-class" data-scroll-init="true"><a href="#toc-1" data-smooth-active="true">Title for first list item</a></li>
That
excluded-class
reference shouldn't be carried over, since there shouldn't be any need to reference things that aren't there.This PR excludes any
:not()
classes from the list item.