Strip non color related ANSI escape sequences from notebook output.

This fixes issue #2385.
pull/37/head
Jack Feser 13 years ago
parent a0544ec066
commit 5f5ac70660

@ -174,6 +174,12 @@ IPython.utils = (function (IPython) {
var cmds = [];
var opener = "";
var closer = "";
// Strip all ANSI codes that are not color related. Matches
// all ANSI codes that do not end with "m".
var ignored_re = /(?=(\033\[[\d;=]*[a-ln-zA-Z]{1}))\1(?!m)/g;
txt = txt.replace(ignored_re, "");
while (re.test(txt)) {
var cmds = txt.match(re)[1].split(";");
closer = opened?"</span>":"";

Loading…
Cancel
Save