lib/output/modifiers/highlightCode.js
function highlightCode(highlight, $) {
    return editHTMLElement($, 'code', function($code) {
        var classNames = ($code.attr('class') || '').split(' ');
        var lang = getLanguageForClass(classNames);
        var source = $code.text();

        return Promise(highlight(lang, source))
        .then(function(r) {
            if (is.string(r.html)) {
                $code.html(r.html);
            } else {
                $code.text(r.text);
            }
        });
    });
}
function highlightCode(highlight, $) {
    return editHTMLElement($, 'code', function($code) {
        var classNames = ($code.attr('class') || '').split(' ');
        var lang = getLanguageForClass(classNames);
        var source = $code.text();

        return Promise(highlight(lang, source))
        .then(function(r) {
            if (is.string(r.html)) {
                $code.html(r.html);
            } else {
                $code.text(r.text);
            }
        });
    });
}
function highlightCode ( highlight , $ ) { return editHTMLElement ( $ , 'code' , function ( $code ) { var classNames = ( $code . attr ( 'class' ) || '' ) . split ( ' ' ) ; var lang = getLanguageForClass ( classNames ) ; var source = $code . text ( ) ; return Promise ( highlight ( lang , source ) ) . then ( function ( r ) { if ( is . string ( r . html ) ) { $code . html ( r . html ) ; } else { $code . text ( r . text ) ; } } ) ; } ) ; }
Highlight all code elements

@param {Function(lang, body) -> String} highlight
@param {HTMLDom} $
@return {Promise}
Highlight all code elements