Chalk: Simplify output for nested chalk tags

Created on 24 Sep 2019  路  4Comments  路  Source: chalk/chalk

Currently, nested chalk tags in聽a聽template reset and聽re鈥憇pecify everything, instead of聽just what needs to聽be聽modified for聽that level of聽nesting.

Code

chalk`{red  red {bold  red & bold } red again }`

Expected result:

\e[31m red \e[1m red & bold \e[22m red again \e[39m

Actual result:

\e[31m red \e[39m\e[31m\e[1m red & bold \e[22m\e[39m\e[31m red again \e[39m

See also:

enhancement help wanted

Most helpful comment

猬囷笍

Screenshot 2020-03-23 at 19 09 06

猬嗭笍

All 4 comments

Yes, that would be ideal, but it's not a big problem as the visual output is still correct. PR welcome :)

There's somewhat a reason for this; dim and bold have the same exit code and thus added some complexity to the implementation IIRC.

Be careful that this doesn't slow everything down.

@sindresorhus @Qix- Is the issue still open?

猬囷笍

Screenshot 2020-03-23 at 19 09 06

猬嗭笍

Was this page helpful?
0 / 5 - 0 ratings

Related issues

macOneOone picture macOneOone  路  6Comments

Offirmo picture Offirmo  路  4Comments

HillTravis picture HillTravis  路  8Comments

roblg picture roblg  路  7Comments

mfour-merickson picture mfour-merickson  路  8Comments