colors.js icon indicating copy to clipboard operation
colors.js copied to clipboard

Template Strings

Open icodeforlove opened this issue 9 years ago • 2 comments

console.log(`one ${'two'.red} three`.blue)

results in

image

\u001b[34mone \u001b[31mtwo\u001b[39m three\u001b[39m

ideally one would be blue as well

icodeforlove avatar Aug 25 '16 17:08 icodeforlove

created template-colors to solve this problem

icodeforlove avatar Aug 29 '16 01:08 icodeforlove

Related: https://github.com/xpl/ansicolor I guess it's due to ANSI codes being processed in linear vs. some hierarchical order. We could consider doing something to make this kind of thing work in colors as well.

DABH avatar Aug 04 '18 21:08 DABH