code-prettify
code-prettify copied to clipboard
Add a couple of hooks
Thanks for the great plugin!
I understand that you want to keep the plugin simple but maybe from developer's point of view it would be really useful if we could have a couple of hooks available for this plugin:
- one that would allow to modify the detected pre/code tags content (for example, wrap them in another tag or do search/replace operations);
- another that would allow to change the
prettyprintedclass to something other.
Thanks for the suggestions @certainlyakey! I'm happy to add any hooks that you would find useful.
allow to modify the detected pre/code tags content
I'm not sure if the Prettify library supports that. Can you please look into that?
allow to change the
prettyprintedclass to something other.
The only issue with that is the CSS styles that come with this plugin -- they would stop working, I think. Secondly, I'm not sure if Prettify supports that.
Thanks for the reply @kasparsd! I see now that I was a bit too fast to submit an issue.
- Actually it seems we can use the Google's prettify's Javascript callback via script URL argument — and the script URL is already conveniently passed through a filter so this one should not be any problem.
- Here the
prettyprintedclass that the plugin adds into WP output has confused me — in the Google's code-prettify docs it's said that the class will beprettyprintso I've thought that you change it somewhere. And it seems that the class is hardcoded, so no way around that, even though I still don't understand about the varying classes names thingie. Regarding the CSS styles — it seems they make no use of theprettyprinted/prettyprintclass name, so this would not become a trouble probably.