##// END OF EJS Templates
small CSS adjustments in notebook...
small CSS adjustments in notebook * add think border around input area * change background instead of foreground on stderr * only stderr/stdout are output_stream, general text (including streams) is output_text * reduce vertical padding on stream output, per @fperez

File last commit:

r4504:981bc0cc
r4883:43d1d58e
Show More
runmode.js
27 lines | 951 B | application/javascript | JavascriptLexer
CodeMirror.runMode = function(string, modespec, callback) {
var mode = CodeMirror.getMode({indentUnit: 2}, modespec);
var isNode = callback.nodeType == 1;
if (isNode) {
var node = callback, accum = [];
callback = function(string, style) {
if (string == "\n")
accum.push("<br>");
else if (style)
accum.push("<span class=\"cm-" + CodeMirror.htmlEscape(style) + "\">" + CodeMirror.htmlEscape(string) + "</span>");
else
accum.push(CodeMirror.htmlEscape(string));
}
}
var lines = CodeMirror.splitLines(string), state = CodeMirror.startState(mode);
for (var i = 0, e = lines.length; i < e; ++i) {
if (i) callback("\n");
var stream = new CodeMirror.StringStream(lines[i]);
while (!stream.eol()) {
var style = mode.token(stream, state);
callback(stream.current(), style);
stream.start = stream.pos;
}
}
if (isNode)
node.innerHTML = accum.join("");
};