Sha256: e3297d40ddd8fe68fcd5d7c4febdb75c731ad666f32b8b9066e10e5ce612ff81

Contents?: true

Size: 638 Bytes

Versions: 26

Compression:

Stored size: 638 Bytes

Contents

/**
 * Module dependencies.
 */

require.paths.unshift(__dirname + '/koala/lib');
var koala = require('koala'),
    sys = require('sys'),
    stdin = process.openStdin();

var str = '';
stdin.addListener('data', function(chunk){
    str += chunk;
});
stdin.addListener('end', function(){
    sys.print(str.replace(/<code>([^]+?)<\/code>/g, function(_, code){
        return looksLikeJavaScript(code)
            ? '<code class="js">' + koala.render('.js', code) + '</code>'
            : '<code>' + code + '</code>';
    }));
});

function looksLikeJavaScript(code){
    return code.indexOf('{') >= 0
        && code.indexOf('(') >= 0;
}

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
vulcan-0.8.2 server/node_modules/connect-form/support/connect/support/highlight.js
vulcan-0.8.1 server/node_modules/connect-form/support/connect/support/highlight.js
vulcan-0.8.0 server/node_modules/connect-form/support/connect/support/highlight.js
vulcan-0.7.2 server/node_modules/connect-form/support/connect/support/highlight.js
vulcan-0.7.1 server/node_modules/connect-form/support/connect/support/highlight.js
vulcan-0.7.0 server/node_modules/connect-form/support/connect/support/highlight.js
vulcan-0.6.1 server/node_modules/connect-form/support/connect/support/highlight.js
vulcan-0.6.0 server/node_modules/connect-form/support/connect/support/highlight.js
vulcan-0.5.0 server/node_modules/connect-form/support/connect/support/highlight.js
vulcan-0.4.0 server/node_modules/connect-form/support/connect/support/highlight.js
vulcan-0.3.0 server/node_modules/connect-form/support/connect/support/highlight.js
vulcan-0.2.5 server/node_modules/connect-form/support/connect/support/highlight.js
vulcan-0.2.4 server/node_modules/connect-form/support/connect/support/highlight.js
vulcan-0.2.3 server/node_modules/connect-form/support/connect/support/highlight.js
vulcan-0.2.2 server/node_modules/connect-form/support/connect/support/highlight.js
vulcan-0.2.1 server/node_modules/connect-form/support/connect/support/highlight.js
vulcan-0.2.0 server/node_modules/connect-form/support/connect/support/highlight.js
vulcan-0.1.6 server/node_modules/connect-form/support/connect/support/highlight.js
vulcan-0.1.5 server/node_modules/connect-form/support/connect/support/highlight.js
vulcan-0.1.4 server/node_modules/connect-form/support/connect/support/highlight.js