DamonT Posted August 25, 2018 Posted August 25, 2018 Hi, is there any way to overwrite default syntax highlighting system in post and use something better (like highlight.js) with auto language detection? Can I overwrite default system or it will be better to add new custom button that will put code in code tag's and conifgure highlight.js to highlight all code tag's?
bfarber Posted August 27, 2018 Posted August 27, 2018 Overriding the default syntax highlighting would be somewhat challenging because we explicitly call prettify() when content is loaded via AJAX, however for this same reason it would probably be easier and more reliable than trying to implement a new one alongside the default. You would have to load the appropriate javascript file, not load prettify, but create a prettify method that can be called as a sort of proxy to the new highlighting plugin you are using.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.