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

Ensure correct compiler error styling and strip ANSI escape sequences. #810

Merged
merged 2 commits into from
Apr 17, 2024

Conversation

chipx86
Copy link
Contributor

@chipx86 chipx86 commented Apr 17, 2024

The compiler error output that's injected into the page hard-codes a background color of white, but didn't hard-code a corresponding text color. If the page had set a default text color that was too close to white, it would be hard or impossible to read without selecting the text on the page.

This change addresses this by hard-coding a text color of black, ensuring it can be read.

It also goes a step further and improves the display when dealing with ANSI escape sequences in the error output, making it difficult to read through or copy/paste meaningful results. We now apply a common regex for stripping away any typical ANSI escape sequences we should expect in such output, leaving behind only the plain text content.

Testing

Triggered a compilation error on a page that had a default text color of white, with a compiler that had many ANSI escape sequences present (rollup.js). I verified that I could now read the text and without the distraction of the escape sequences.

Ran tox. Unit tests pass.

chipx86 and others added 2 commits April 16, 2024 22:45
The compiler error output that's injected into the page hard-codes a
background color of white, but didn't hard-code a corresponding text
color. If the page had set a default text color that was too close to
white, it would be hard or impossible to read without selecting the text
on the page.

This change addresses this by hard-coding a text color of black,
ensuring it can be read.

It also goes a step further and improves the display when dealing with
ANSI escape sequences in the error output, making it difficult to read
through or copy/paste meaningful results. We now apply a common regex
for stripping away any typical ANSI escape sequences we should expect in
such output, leaving behind only the plain text content.
@davidt
Copy link
Contributor

davidt commented Apr 17, 2024

Looks good to me.

@davidt davidt merged commit 0d450e5 into jazzband:master Apr 17, 2024
17 of 18 checks passed
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

Successfully merging this pull request may close these issues.

2 participants