Closed mlucool closed 7 years ago
This also applies to: 23 Not italic, not Fraktur 24 Underline: None Not singly or doubly underlined
It would be nice to have. And possibly a little tricky to implement. I would think you'd need to at least account for the two scenarios here: https://github.com/rburns/ansi-to-html/commit/1fc513cf1ae170094c0635d1d5bd23d30f786776. But, you can probably imagine other scenarios where mismatched opening/closing tags could arise.
Having said that, 24 Underline is already implemented. And doesn't appear to take into account those edge cases. https://github.com/rburns/ansi-to-html/blob/unstyle/test/ansi_to_html.coffee#L118-L121 https://github.com/rburns/ansi-to-html/blob/unstyle/src/ansi_to_html.coffee#L129 So, maybe it's not a practical problem.
Not sure when I'll find the time to look at this in more detail. Could be soon. Patches welcome, in any case.
well, disabling underline actually has more protections against those edge cases than I thought. And I implemented disabling bold. https://github.com/rburns/ansi-to-html/compare/unstyle
it appears that italic (3) is currently implemented to render as underlined text https://github.com/rburns/ansi-to-html/blob/unstyle/src/ansi_to_html.coffee#L124. Should fix that before implementing 23 Not italic.
:+1: Thanks for looking into this so quickly
Hi,
Please add support for escape code 22.
Per Wikipedia: https://en.wikipedia.org/wiki/ANSI_escape_code
22 Normal color or intensity Neither bold nor faint
Example:
Link: https://runkit.com/585164c7c92fa7001463dd8b/585167e71ca9e00014bc2cff
The
</b>
is around the whole expression instead of correctly around just Hello.This comes up because chalk uses this (and it works just fine with node cli):