-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Added new Not all plugin #2074
Added new Not all plugin #2074
Conversation
Thanks for this, @RunDevelopment! Much appreciated! 🙏 |
I just thought that it would be completely awesome if this was possible to configure in a |
Done. Now you can do the following: <script src="prism.js" data-exclude-css=".no-highlight, .no-highlight *"></script> This will exclude all element with a As for the original issue: You can either use <script src="prism.js" data-filter-known></script> Or define a filter function: <script src="prism.js"></script>
<script>
Prism.plugins.notAll.filter(({ language }) => language !== 'mermaid');
</script> |
@RunDevelopment, Fantastic! 🎉 Thank you so much! 🙏 |
Sorry I took so long to get to this. Thanks for your patience! |
Just need to bikeshed some naming here but the code itself is great! Thanks for your patience. |
Should be good to go now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That took some massaging, but this looks good to me! Thanks for the work on this. One more PR to go for this release...
This adds a new plugin Not all with allows to filter out certain elements the
highlightAll
andhighlightAllUnder
methods query.This adds a new
filter
property to the env ofbefore-highlightall
which can be used to add filters. I named itfilter
because it very much behaves likeArray#filter
.This also exposes
getLanguage
asPrism.util.getLanguage
.@asbjornu
My attempt to fix #2068.