-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
No way to force color in browser #132
Comments
How would you pass |
Line 3 in 4f459ee
|
There isn't any, that's exactly what I meant.
Hmm, indeed, however I still got no color for some reason (maybe 'basic' was not enough for the library I was using, not sure). Anyway, it would be nice if |
@sindresorhus we should make sure we're not bumping up against this: https://blog.chromium.org/2021/05/update-on-user-agent-string-reduction.html @roman-khazanskii could you paste here the value of |
@Qix- sure - But I'm afraid you are missing my original point. I didn't actually need colors in my browser console, I wanted to transform ANSI-colored string to HTML (even though my browser console did support color as well, these things are not connected). |
I have no idea what you're asking, then. This library doesn't do that, and none of chalk's code outputs HTML. |
I know! I just want a way to force color support, that's all :) So other library will give me ANSI-colored text and then I will transform it to HTML. Sorry if I'm not being very clear from the beginning; I just want to force-enable color support, even in the browser. |
I'm bumping into this now —
But creating a new custom instance that forces color support with User agent is |
Ah, I'm now seeing that Chalk v4 is using supports-color v7, which explicitly disables browser color support in |
As far as I could understand,
browser.js
ignores any means of color enforcing;FORCE_COLOR
is ignored, now way of passing--color
- and anyway, browser.js just returns 'false'.Even though chrome console, for instance, does support ansi-color.
So if I need to force some other library, depending on this one, to give me back colorized output (that I can transform to html with smthn like
ansi-html
), I have to resort to monkey-patching.The text was updated successfully, but these errors were encountered: