Some of the issues mentioned in this thread have been improved, including private CSI sequences, default param values, and cancellation + substitution.
The lexer and parser handled it perfectly first try. The HTML renderer had a few issues though, but it's being rendered reasonably well now. The torture test has been added to the package tests and to the website as an example.
That's some interesting feedback, thanks for sharing. I'll see what I can extract and apply from it. Please bear with me, this is only my initial take on the whole concept (and as you point out, it isn't that trivial). Didn't have much examples to be inspired by, but we're on our way anyway.
The parser has, but not the HTML renderer indeed. Using a third-party lib for that currently, but noticed the limitations too. Might replace it with my own!
Got to start somewhere! Didn't see many examples to get inspired by either. Here's the full table: https://ansi.tools/lookup. This is my initial take on it. Please bring in the corneriest cases! It's open source so bug reports, RFCs and pull requests are most welcome.
Working with and debugging ANSI control codes and escape sequences can be a challenge.
This free web-based tool helps to inspect the input, visualize colors and styling, and list control codes. By using a proper tokenizer and parser (not just regex hacks), it supports all sorts of control codes. The parser is open source and available too (find links in "about").
Type or paste text in the black text area, or try out the examples. Use the lookup table to filter & find specific codes.
Feedback welcome, I’d love to know what’s confusing, missing, or especially useful.