ansi2html
ansi2html copied to clipboard
reset
This is a very fine script!
Could you please handle reset?
# tput sgr0|hexdump -C
00000000 1b 28 42 1b 5b 6d |.(B.[m|
And please add this to pre's style to break long lines:
white-space: pre-wrap;
word-wrap: break-word;
And please add this to pre's style to break long lines:
This would be an easy pull-request. Would you like to be the one to add it?
Please handle tput sgr0
: revert back the current schema's color OR tell me how to reset that your script understands.
http://manpages.ubuntu.com/manpages/hardy/man5/terminfo.5.html
s0ds s0 Shift to codeset 0 (EUC set 0, ASCII)
...
s0ds=\E(B
So \E(B
is "Shift to codeset 0". I do not know what it is.
I'd like to just "turn off all attributes" by tput
.
I'll take a look at handling sgr0
when I can. It seems like it would need to close as many </span>
tags as had been opened.
Very dirty.
cat "${HC_LOG}.txt" \
| ansi2html --title="$HC_DOMAIN" --linkify --font-size=13px --light-background -s xterm \
| sed 's/\x1B(B\b//g' > "${HC_LOG}.html"
A 3-year-old bug still not resolved? :(
And please add this to pre's style to break long lines:
white-space: pre-wrap; word-wrap: break-word;
That was added in 2014 for release 1.0.7 by commit 418bef2f03dd36e7ad0dac663db0e917879d3dee .
Could you please handle reset?
# tput sgr0|hexdump -C 00000000 1b 28 42 1b 5b 6d |.(B.[m|
I'm unsure about how that^^ sgr0 differs from \x1b[0m
(Wikipedia) semantically (if so). The latter is supported…
# hexdump -C <<<$'\x1b[0m'
00000000 1b 5b 30 6d 0a |.[0m.|
00000005
# echo $'\x1b[31mhello red\x1b[0m and hello normal' | ansi2html --inline
<span style="color: #aa0000">hello red</span> and hello normal
…since 2013 release 0.10.0 commit fce66a6a905fb6aa006cfa1f6ad4716ebb46e63b.