Syntax Highlight for Drupal with Built-in highlight.js on CKEditor
It's almost 2 years since I wrote about Highlight.js on this blog.
And suddenly few days ago after I update to latest version of CKEditor, the syntax highlighting process on this blog got problem.
I decide to re-install HighlightJS and also the CKEditor (now with CDN data).
Since CKEditor 4.4, it has new feature, syntax highlighting, and the default mechanism using Highlight.JS .
Here's few steps on my Highlight.js updates:
- remove CKEditor module
- remove Highlight.js module (also the filter)
- install CKEditor module with CDN data, so no need to upload CKEditor library anymore.
- disable CKEditor ACF so I can use tag <code>
- edit my Drupal theme (based on best_responsive) style.css. I remove the background, margin and padding
- add css and js to theme's header (on file templates/html.tpl.php)
or you can install CKEditor codesnippet plugin , and change the URL:
- and done! all the previous codes with tag <pre><code>MYCODE</code></pre> are back highlighted.