You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
wrap-ansi can distribute escape sequence to wrapped lines. However, if there are multiple escape sequences only one of them is distributed.
Code
importchalkfrom'chalk';importwrapAnsifrom'wrap-ansi';constgreenString=chalk.green('This is a green string.')console.log(splitWithRedLines(wrapAnsi(greenString,10)));constboldString=chalk.bold('This is a bold string.')console.log(splitWithRedLines(wrapAnsi(boldString,10)));constblueBoldString=chalk.blue.bold('This is a blue and bold string.')console.log(splitWithRedLines(wrapAnsi(blueBoldString,10)));functionsplitWithRedLines(string){returnstring.split("\n").join(chalk.red("\n---\n"))}
Result
For greenString and boldString, corresponding escape sequences (\x1B[32m and \x1B[1m) are correctly copied to each line of resulting string.
However, for blueBoldString which contains two escape sequences (\x1B[34m\x1B[1m), only one of them (\x1B[1m) is copied to each line, and the other (\x1B[34m) remains at the very start of the resulting string.
As a result, the resulting string may break when another styled string intervenes the lines.
The text was updated successfully, but these errors were encountered:
Hi, thank you for the great package!
Bug Report
wrap-ansi
can distribute escape sequence to wrapped lines. However, if there are multiple escape sequences only one of them is distributed.Code
Result
For
greenString
andboldString
, corresponding escape sequences (\x1B[32m
and\x1B[1m
) are correctly copied to each line of resulting string.However, for
blueBoldString
which contains two escape sequences (\x1B[34m\x1B[1m
), only one of them (\x1B[1m
) is copied to each line, and the other (\x1B[34m
) remains at the very start of the resulting string.As a result, the resulting string may break when another styled string intervenes the lines.
The text was updated successfully, but these errors were encountered: