##// END OF EJS Templates
Merge pull request #2194 from minrk/clean_nan...
Merge pull request #2194 from minrk/clean_nan Clean nan/inf in json_clean. The floating point values NaN and Infinity are not part of the JSON specification and causes some parsers to throw errors. Since our usage is only for things like the display of function defaults, we can use a basic string representation ('NaN', 'inf', etc) instead.

File last commit:

r5970:b6bb1663
r8047:157d99af merge
Show More
runmode.js
27 lines | 968 B | application/javascript | JavascriptLexer
Brian E. Granger
Updating CodeMirror to v 2.12....
r4504 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);
Brian Granger
Updating to CodeMirror 2.2, latest stable release.
r5941 callback(stream.current(), style, i, stream.start);
Brian E. Granger
Updating CodeMirror to v 2.12....
r4504 stream.start = stream.pos;
}
}
if (isNode)
node.innerHTML = accum.join("");
};