Comparing version 1.1.1 to 1.1.2
// ansi_up.js | ||
// version : 1.1.0 | ||
// version : 1.1.2 | ||
// author : Dru Nelson | ||
@@ -10,3 +10,3 @@ // license : MIT | ||
var ansi_up, | ||
VERSION = "1.1.0", | ||
VERSION = "1.1.2", | ||
@@ -92,5 +92,10 @@ // check for nodeJS | ||
// Do proper handling of sequences (aka - injest vi split(';') into state machine | ||
//match,codes,txt = text.match(/([\d;]+)m(.*)/m); | ||
var matches = text.match(/([\d;]*)m([^]*)/m); | ||
// Each 'chunk' is the text after the CSI (ESC + '[') and before the next CSI/EOF. | ||
// | ||
// This regex matches two groups within a chunk. | ||
// The first group matches all of the number+semicolon command sequences | ||
// before the 'm' character. These are the graphics or SGR commands. | ||
// The second group is the text (including newlines) that is colored by | ||
// the first group's commands. | ||
var matches = text.match(/([\d;]*)m([\s\S]*)/m); | ||
@@ -97,0 +102,0 @@ if (!matches) return text; |
{ | ||
"name": "ansi_up", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Convert ansi sequences in strings to colorful HTML", | ||
@@ -5,0 +5,0 @@ "keywords": ["ansi", "html"], |
@@ -89,2 +89,3 @@ # ansi_up.js | ||
- Aaron Stone (<https://github.com/sodabrew>) | ||
- Maximilian Antoni (<https://github.com/mantoni>) | ||
@@ -91,0 +92,0 @@ |
156703
722
115
14