Comments (6)
Frankly I don't know what those escape sequences mean, I just use https://github.com/chalk/chalk
from cli-highlight.
so, the issue is that when "your code" is returning to "default text", there are two ways of doing it
^[39m is "white"
^[0m is "default"
I suppose you have asked chalk to "go to white". I tried to have a look myself, but i couldnt see where the logic for the code was. I can have a look if you like, if you can point me in roughly the right direction
You can imagine, without ever "going to default", some tools are creating extremely nested output
from cli-highlight.
The nodes are wrapped in escape sequences here:
Line 17 in c075112
with the default theme being defined here:
Line 294 in c075112
from cli-highlight.
ok, Ill have a look.
At the moment im processing the output with sed to do the same.
Thanks :)
Christopher
from cli-highlight.
^[39m is "white"
This is not correct. That code escape closes/resets a foreground color.
See: https://github.com/chalk/ansi-styles/blob/de7527a86c1cf49906b0eb32a0de1402d849ccc2/index.js#L34-L51
from cli-highlight.
ok, so I spoke to chalk, they explained what [39m and [0m mean:
[39m means "reset the foreground color to default"
[0m means "reset everything to default"
So they reckon that it is the script I am using that is bugged, not the output of cli-highlight that should be changed :)
Cheers :)
from cli-highlight.
Related Issues (20)
- Upgrade to Highlight.js v10 HOT 6
- Cli-highlight issue, with chalk.js for Nest.js application
- Output contains ANSI escape code if redirecting output to file HOT 3
- Upgrade to Highlight.js v10.4.1 (or higher) HOT 6
- UnhandledPromiseRejectionWarning: TypeError: value.replace is not a function HOT 3
- Pretty print?
- [Question] Text in clipboard > Highlight > Put back in clipboard HOT 2
- Use Highlight.js themes?
- Beautiful and exceptional library
- Port to deno?
- Version 10 of node.js has been released
- Action Required: Fix Renovate Configuration
- cli-highlight errors out with certain inputs even though `ignoreIllegals` is set to true HOT 5
- Dependency deprecation warning: validate-commit-msg (npm)
- Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue HOT 3
- The automated release is failing 🚨
- Feature request: custom languages HOT 1
- Is there a way to use for highlighting the node repl or ts-node? HOT 1
- Change theme HOT 1
- Dependency Dashboard
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cli-highlight.