ansi-html icon indicating copy to clipboard operation
ansi-html copied to clipboard

Doesn't recognize RGB colors supported by newer versions of chalk.

Open danfuzz opened this issue 7 years ago • 1 comments

  • Example code:
const chalk = require('chalk');
const ansiHtml = require('ansi-html');
const inspect = require('util').inspect;

chalk.enabled = true;
chalk.level = 3;
const c = chalk.hex('#405060')('Hello');
const h = ansiHtml(c);

console.log(inspect(c));
console.log(inspect(h));
  • Expected output:

Something like this:

'\\u001b[38;2;64;80;96mHello\\u001b[39m'
'<span style="color:#405060;">Hello</span>'
  • Actual output
'\\u001b[38;2;64;80;96mHello\\u001b[39m'
'\\u001b[38;2;64;80;96mHello</span>'

danfuzz avatar Dec 19 '17 20:12 danfuzz

thx, 'll figure it out

Tjatse avatar Dec 21 '17 05:12 Tjatse