Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text state carries between separate calls to ansi_to_html after upgrading to v6.0.0 #88

Closed
cmparsons opened this issue Aug 22, 2023 · 2 comments

Comments

@cmparsons
Copy link

Hey there!

We use this library for rendering deploy logs at Netlify. When upgrading to 6.0.0, I've noticed that if one call to ansi_to_html detects an ansi value that should bold the text, that bold state carries over to subsequent calls to ansi_to_html.

I've created a CodeSandbox comparing 5.2.1 and 6.0.0 behavior. The first bold ansi value appears around the Netlify Build line. In 6.0.0, it bolds all subsequent lines while this doesn't happen in v5.

A workaround is to create a new instance of AnsiUp for every call.

@silverwind
Copy link

I had been observing the same statefulness in v5.2.1 as well, thought it to be working as intended. For example a unclosed color opening sequence carried over to subsequent ansi_to_html calls.

@drudru
Copy link
Owner

drudru commented Aug 25, 2023

@cmparsons - hi. thanks, I found the issue. I was being a little too pedantic with the "standard" SGR sequences.
Getting a fix together now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants