mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-27 04:20:22 +08:00
fix regular expression for ANSI escapes
wouldn't catch `\x1b[01;`, only `\x1b[0;` or `\x1b[1;`. closes #3614
This commit is contained in:
parent
641a5e153b
commit
55192ef881
@ -178,11 +178,11 @@ IPython.utils = (function (IPython) {
|
||||
// `\033[Xm` == `\033[0;Xm` sets foreground color to `X`.
|
||||
//
|
||||
str = str.replace(
|
||||
new RegExp('\033\\[([01];)?' + ansi + 'm', 'g'), span
|
||||
new RegExp('\033\\[(0?[01];)?' + ansi + 'm', 'g'), span
|
||||
);
|
||||
});
|
||||
|
||||
str = str.replace(/\033\[([01]|39|22)?m/g, '</span>');
|
||||
str = str.replace(/\033\[(0?[01]|39|22)?m/g, '</span>');
|
||||
return str;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user