I'm looking for a code library that converts ANSI escape sequences into HTML color, via plain tags or CSS. For example, something that would convert this:
ESC[00mESC[01;34mbinESC[00m
ESC[01;34mcodeESC[00m
ESC[01;31mdropbox-lnx.x86-0.6.404.tar.gzESC[00m
ESC[00mfooESC[00m
Into this:
<span style="color:blue">bin</span>
<span style="colo...
This is a similar question to this one. I would like to convert ANSI escape sequences, especially for color, into HTML. However, I would like to accomplish this using PHP. Are there any libraries or example code out there that do this? If not, anything that can get me part way to a custom solution?
...
Using terminal sequences, I can colour text in a terminal emulator:
$ echo -e '\e[37;41m--this is white on red--\e[0m'
And this works.
The following prints a red rectangle, i.e. space characters have a red background and an empty foreground:
$ echo -e '\e[37;41m \e[0m '
But the following prints two red rectangles separated by ...