diff --git a/addon/runmode/runmode.node.js b/addon/runmode/runmode.node.js index 9767a75f4cafb3231da9cf9f54b765e71a4b22d5..a6ea919d83d25e2e93f55b298843f75bc2679775 100644 --- a/addon/runmode/runmode.node.js +++ b/addon/runmode/runmode.node.js @@ -68,6 +68,12 @@ exports.defineMode = function(name, mode) { modes[name] = mode; }; exports.defineMIME = function(mime, spec) { mimeModes[mime] = spec; }; + +exports.defineMode("null", function() { + return {token: function(stream) {stream.skipToEnd();}}; +}); +exports.defineMIME("text/plain", "null"); + exports.getMode = function(options, spec) { if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) spec = mimeModes[spec]; diff --git a/bin/source-highlight b/bin/source-highlight index 730935756e3c747e2459f5384ce55151343af02a..7596ed776ca04d432d05b52867cdfbd99ce62cc2 100755 --- a/bin/source-highlight +++ b/bin/source-highlight @@ -27,7 +27,7 @@ CodeMirror.modeInfo.forEach(function(info) { }); function ensureMode(name) { - if (CodeMirror.modes[name]) return; + if (CodeMirror.modes[name] || name == "null") return; try { require("../mode/" + name + "/" + name + ".js"); } catch(e) {