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

Support ANSI colored text in code blocks. #1940

Open
motlin opened this issue Mar 10, 2025 · 0 comments
Open

Support ANSI colored text in code blocks. #1940

motlin opened this issue Mar 10, 2025 · 0 comments

Comments

@motlin
Copy link

motlin commented Mar 10, 2025

I would like to add support for rendering console logs containing ansi color codes using the actual colors.

I have files checked in with the *.log file extension. They are the actual console logs of a CLI that it emits during tests. Each test asserts that the console output exactly matches the contents of a specific output file. Since the CLI emits logs with color codes, these log files are readable from the console but not very readable in GitHub. [example]

I raised a similar request in Linguist and was redirected here, since Linguist does not manipulate text and would not strip out / replace the color codes.

There is a long thread on colors in markdown on #1440 which is a different feature. I saw the same feature requested there, but it's a bit buried in the comment chain.

I would like ANSI colored text in code blocks, i.e.

```ansi

[ANSI-formatted text with color escape codes]

```

which allows for pasting of ANSI terminal output, as one might obtain on Linux with

unbuffer <command with ANSI output> | xclip

I know Discord's Markdown has this feature. It's handy for when programs have colored output that makes it easier to find important details, such as errors, which is something GitHub is supposed to specialize in (software development)...

Originally posted by @Zi7ar21 in #1440

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

1 participant