* Only allow two digits for Renegade style pipe codes

This commit is contained in:
Bryan Ashby 2015-07-02 15:20:39 -06:00
parent fa7cf1f265
commit a1a4c09214
1 changed files with 3 additions and 3 deletions

View File

@ -25,7 +25,7 @@ function renegadeToAnsi(s) {
} }
var result = ''; var result = '';
var re = /\|(\d{2,3}|\|)/g; var re = /\|(\d{2}|\|)/g;
var m; var m;
var lastIndex = 0; var lastIndex = 0;
while((m = re.exec(s))) { while((m = re.exec(s))) {
@ -42,7 +42,7 @@ function renegadeToAnsi(s) {
val = 0; val = 0;
} }
assert(val >= 0 && val <= 256); assert(val >= 0 && val <= 256); // :TODO: should be <= 23 I believe
var attr = ''; var attr = '';
if(7 == val) { if(7 == val) {
@ -63,6 +63,6 @@ function renegadeToAnsi(s) {
} }
function stripRenegadeCodes(s) { function stripRenegadeCodes(s) {
return s.replace(/\|[\d]{2,3}/g, ''); return s.replace(/\|[\d]{2}/g, '');
} }