-
Notifications
You must be signed in to change notification settings - Fork 5
Reset color when the index is 9 #3
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
Reset color when the index is 9 #3
Conversation
Match [_9m color to reset color with inherit css attribute
|
I don't know yet what this 9 value means, but it does not looks like a 4bit color code. Then using inherit does not seems to work in nested context, for example running this command: $ echo -e "\x1b[32;1m Green \x1b[39;1m inherited \x1b[0m"Display Green in green, and inherited in white. But the html encoding will be: <span style="color: green">Green<span style="color: inherit">inherited</span></span>... which does not make the inherited field white. |
|
So according to the first paragraph of https://en.wikipedia.org/wiki/ANSI_escape_code#3-bit_and_4-bit , |
Co-authored-by: Tristan de Cacqueray <tdecacqu@redhat.com>
|
I just want to verify if the value "initial" revert to color asign to a balise type. Like .myclass span { color:black; } or to initial color of navigator. in prevision of dark theme or terminal like background |
|
Initial does not seems to use the class style, e.g.: <html>
<head>
<style>
.myclass {
color: pink;
}
</style>
</head>
<body>
<span style="color: green">
Green
<span class=myclass style="color: initial">inherited</span>
</span>
</body>
</html>... display |
|
Alternatively, it seems like we could use a new AnsiCode constructor to combine Clear and Style, and we could adapt the render function to terminate the previous style in Lines 257 to 262 in 4d94ab3
Though that would be a significant change, so it would be good to look for a simpler css trick first. |
|
I'm ok with you for "initial" value. |
|
Alright, then let's go with the |
Match [_9m color to reset color with inherit css attribute
Fixes: #1