ansi-to-html
Advanced tools
Comparing version 0.6.15 to 0.7.0
@@ -9,5 +9,5 @@ 'use strict'; | ||
function _createForOfIteratorHelper(o) { if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (o = _unsupportedIterableToArray(o))) { var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var it, normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; } | ||
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; } | ||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } | ||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } | ||
@@ -132,4 +132,6 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } | ||
result = handleDisplay(stack, data, options); | ||
} else if (token === 'xterm256') { | ||
} else if (token === 'xterm256Foreground') { | ||
result = pushForegroundColor(stack, options.colors[data]); | ||
} else if (token === 'xterm256Background') { | ||
result = pushBackgroundColor(stack, options.colors[data]); | ||
} else if (token === 'rgb') { | ||
@@ -382,7 +384,12 @@ result = handleRgb(stack, data); | ||
function removeXterm256(m, g1) { | ||
callback('xterm256', g1); | ||
function removeXterm256Foreground(m, g1) { | ||
callback('xterm256Foreground', g1); | ||
return ''; | ||
} | ||
function removeXterm256Background(m, g1) { | ||
callback('xterm256Background', g1); | ||
return ''; | ||
} | ||
function newline(m) { | ||
@@ -450,4 +457,7 @@ if (options.newline) { | ||
pattern: /^\x1b\[38;5;(\d+)m/, | ||
sub: removeXterm256 | ||
sub: removeXterm256Foreground | ||
}, { | ||
pattern: /^\x1b\[48;5;(\d+)m/, | ||
sub: removeXterm256Background | ||
}, { | ||
pattern: /^\n/, | ||
@@ -454,0 +464,0 @@ sub: newline |
{ | ||
"name": "ansi-to-html", | ||
"version": "0.6.15", | ||
"version": "0.7.0", | ||
"description": "Convert ansi escaped text streams to html.", | ||
@@ -83,2 +83,6 @@ "main": "lib/ansi_to_html.js", | ||
"url": "https://github.com/mapleeit" | ||
}, | ||
{ | ||
"name": "remolueoend", | ||
"url": "https://github.com/remolueoend" | ||
} | ||
@@ -88,12 +92,12 @@ ], | ||
"devDependencies": { | ||
"@babel/cli": "^7.8.4", | ||
"@babel/core": "^7.9.0", | ||
"@babel/preset-env": "^7.9.5", | ||
"chai": "~4.2.0", | ||
"eslint": "^6.8.0", | ||
"mocha": "^7.1.1", | ||
"nyc": "^15.0.1" | ||
"@babel/cli": "^7.14.0", | ||
"@babel/core": "^7.14.0", | ||
"@babel/preset-env": "^7.14.0", | ||
"chai": "^4.3.0", | ||
"eslint": "^7.0.0", | ||
"mocha": "^9.0.0", | ||
"nyc": "^15.1.0" | ||
}, | ||
"dependencies": { | ||
"entities": "^2.0.0" | ||
"entities": "^2.2.0" | ||
}, | ||
@@ -100,0 +104,0 @@ "bin": { |
@@ -157,3 +157,3 @@ 'use strict'; | ||
it('renders xterm 256 sequences', function (done) { | ||
it('renders xterm 256 foreground sequences', function (done) { | ||
const text = '\x1b[38;5;196mhello'; | ||
@@ -165,2 +165,9 @@ const result = '<span style="color:#ff0000">hello</span>'; | ||
it('renders xterm 256 background sequences', function (done) { | ||
const text = '\x1b[48;5;196mhello'; | ||
const result = '<span style="background-color:#ff0000">hello</span>'; | ||
return test(text, result, done); | ||
}); | ||
it('renders foreground rgb sequences', function (done) { | ||
@@ -167,0 +174,0 @@ const text = '\x1b[38;2;210;60;114mhello'; |
@@ -88,3 +88,3 @@ 'use strict'; | ||
it('prints version', async function () { | ||
const result = '0.6.14\n'; | ||
const result = '0.7.0\n'; | ||
let stdout = await runCLI('node lib/cli --version'); | ||
@@ -91,0 +91,0 @@ expect(stdout).to.equal(result); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
78030
1036
Updatedentities@^2.2.0