Monthly Archives: April 2012

griffin.editor: Added support for Google Prettify

I’ve just refactored the highlighting features of griffin.editor. You can now use your favorite highlighter by implementing the $.griffinEditorExtension.highlighter callback like this:

$.griffinEditorExtension.highlighter = function(inlineSelector, blockSelector) {
    $.each(blockSelector, funtion() {
        console.log('Code block to highlight: ' + $(this).html());
    };
}

The default implementation looks for either highlight.js or Google Prettify.

I’ve also made a small change so that the inline code blocks aren’t highlighted per default. It makes the text more readable imho (and the programming language guessing in the highlights have too little code to guess on).