Strip more ANSI escape sequence.

`?` can be found in ANSI escape sequence. ( `[?25l` hide cursor,
`[25k`show cursor)

Closes #95
pull/444/head
Matthias Bussonnier 10 years ago
parent cc32f165e8
commit e5ed972467

@ -348,7 +348,7 @@ define([
// 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;
var ignored_re = /(?=(\033\[[?\d;=]*[a-ln-zA-Z]{1}))\1(?!m)/g;
txt = txt.replace(ignored_re, "");
// color ansi codes

@ -5,6 +5,7 @@ casper.notebook_test(function () {
"\033[0m[\033[33mwarn\033[0m] \033[0m https://some/url/to/a/file.ext\033[0m",
"\033[0m[\033[31merror\033[0m] \033[0m\033[0m",
"\033[0m[\033[31merror\033[0m] \033[0m\teven more text\033[0m",
"[?25hBuilding wheels for collected packages: scipy",
"\033[0m[\033[31merror\033[0m] \033[0m\t\tand more more text\033[0m"].join("\n");
var output = [
@ -13,6 +14,7 @@ casper.notebook_test(function () {
"[<span class=\"ansiyellow\">warn</span>] https://some/url/to/a/file.ext",
"[<span class=\"ansired\">error</span>] ",
"[<span class=\"ansired\">error</span>] \teven more text",
"Building wheels for collected packages: scipy",
"[<span class=\"ansired\">error</span>] \t\tand more more text"].join("\n");
var result = this.evaluate(function (input) {

Loading…
Cancel
Save