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

Remove ANSI control chars from GitHub step Summary and PR comment #1312

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

byian
Copy link

@byian byian commented Nov 25, 2024

This PR introduces striping of ANSI symbols for GitHub step Summary and improves the current one for PR comments.

To resolve #1248

This is similar to #1231, but uses a slightly different approach. Instead of converting ANSI symbols to html tags (using the ansi-to-html package), which results in \x1b[30mblack becoming <span style="color:#000">black</span>, we simply remove them using a regular expression, which results in \x1b[30mblack becoming just black.

The reason is that neither the Summary nor the PR comment is able to actually render the <span style="color:#000"> block with color. However, all these html tags consume limits for PR comment length and Summary size.

@byian byian requested a review from a team as a code owner November 25, 2024 16:40
@byian
Copy link
Author

byian commented Dec 2, 2024

Hi @tgummerer, do you by any chance have time to take a look at this PR?

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.

Colors code on summary should not be printed
1 participant