From a1a4c092143de66d315f78194541af4a7c0ad3b4 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Thu, 2 Jul 2015 15:20:39 -0600 Subject: [PATCH] * Only allow two digits for Renegade style pipe codes --- core/color_codes.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/color_codes.js b/core/color_codes.js index 4e5a46f5..a3fe5070 100644 --- a/core/color_codes.js +++ b/core/color_codes.js @@ -25,7 +25,7 @@ function renegadeToAnsi(s) { } var result = ''; - var re = /\|(\d{2,3}|\|)/g; + var re = /\|(\d{2}|\|)/g; var m; var lastIndex = 0; while((m = re.exec(s))) { @@ -42,7 +42,7 @@ function renegadeToAnsi(s) { val = 0; } - assert(val >= 0 && val <= 256); + assert(val >= 0 && val <= 256); // :TODO: should be <= 23 I believe var attr = ''; if(7 == val) { @@ -63,6 +63,6 @@ function renegadeToAnsi(s) { } function stripRenegadeCodes(s) { - return s.replace(/\|[\d]{2,3}/g, ''); + return s.replace(/\|[\d]{2}/g, ''); }