mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-24 12:05:22 +08:00
Strip non color related ANSI escape sequences from notebook output.
This fixes issue #2385.
This commit is contained in:
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…
Reference in New Issue
Block a user