Closed matteodepalo closed 1 year ago
I agree this needs to be fixed in ansi-tokenize
Fixed in v0.1.3
: https://github.com/AlCalzone/ansi-tokenize/releases/tag/v0.1.3
(except that your test has extra "
around the string)
@AlCalzone thank you for fixing this so quickly! I've bumped the version in this PR.
@AlCalzone we also saw a difference in the ansi escapes related to colors when upgrading. For example this component
<Box>
<Text color="red">hello</Text>
<Text color="green">world</Text>
</Box>
Before it would produce
'[31mhello[39m[32mworld[39m'
Now it produces
'[31mhello[32mworld[39m'
There seems to be a missing [39m
after the first word which I think it's the code to reset the color? Not sure if this is a difference in the way chalk
works, maybe it has been updated? The end result doesn't seem to change much in our outputs.
That's expected. ansi-tokenize uses the least amount of ansi codes necessary for a style change.
Got it! Make sense, I'll update our tests.
Thanks @matteodepalo for the PR and thanks @AlCalzone for fixing it so quickly 💛
A bug has been introduced with the work done here and it relates to the tokenization of ansi escape characters. We noticed it with
ansiEscapes.link
and I added a test case in this repo which now fails.@AlCalzone I don't know enough about your
ansi-tokenize
project, but could this be fixed there?Here's a screenshot of the failing test:
You can see from the screenshot that the link escape is not being closed properly so the link "leaks" in all the text after that.