From 55192ef8819a09cab763eb0857a4408e9acbb62e Mon Sep 17 00:00:00 2001 From: MinRK Date: Thu, 11 Jul 2013 12:19:03 -0700 Subject: [PATCH] fix regular expression for ANSI escapes wouldn't catch `\x1b[01;`, only `\x1b[0;` or `\x1b[1;`. closes #3614 --- IPython/html/static/base/js/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IPython/html/static/base/js/utils.js b/IPython/html/static/base/js/utils.js index 6b89aedbb..c64bd12c2 100644 --- a/IPython/html/static/base/js/utils.js +++ b/IPython/html/static/base/js/utils.js @@ -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, ''); + str = str.replace(/\033\[(0?[01]|39|22)?m/g, ''); return str; };