Comments (6)
It seems to be the '[m' sequences which confuse it. If I remove those something approaching correct comes out. From what I can find on the web the correct sequences involving 'm' look like this: ESC[#(;#)m. ie there should be at least a number preceeding the 'm' , and possibly a ';#' in addition. as in the other sequences in the string. (eg [1;31m) http://bluesock.org/~willg/dev/ansi.html
from ansi-to-html.
interesting. so this would be considered a bug in git then? This is being generated from git diff --color-words.
from ansi-to-html.
the [m appears to be a color reset, which should be possible to handle. I'll have a look.
https://github.com/git/git/blob/018bc80d140aff02f61e3a5100dd1367311d38ff/color.h
from ansi-to-html.
nice. no rush on my end. I have managed to solve my issues by just parsing the ansi with regex. I appreciate the quick responses though.
from ansi-to-html.
It turns out '[m' was being handled correctly, what was causing the error were two sequences together eg [m[1;32m. The parser was mangling the second sequence. I've committed a fix for that. can you test it out?
From looking around, my best guess is that [0m is actually the reset code. Though if git produces [m it's at least common.
from ansi-to-html.
Does not seem to fix it. The ansi from git is:
months remainingESC�[1;31mtimesESC�[mESC�[1;32mmultiplied byESC�[m $10
and that turns into
months remaining <b><span style="color:#A00">times</span></b>2mmultiplied by $10
Again, I'm probably not going to be using it though since i solved my issues with regex since its only a few common ansi characters im looking for.
from ansi-to-html.
Related Issues (20)
- Infinite loop with specific ANSI string HOT 2
- (love) Just to tell you how great your software is
- Support for erase-line (\x1b[2K) and \r
- Consider "initial" or similar as the default background color
- underline stickiness HOT 7
- Factor out generic parser and add ANSI-to-browser-console-log HOT 1
- inverse color is ignored HOT 3
- Multi `\r` makes following message disappear HOT 3
- Performance issue because of lots of nested layers HOT 4
- No support to convert \t? HOT 2
- Support for `Reset all attributes` sequence HOT 5
- Failure on \r sequences HOT 11
- Ship ES6 module HOT 3
- Output is broken when input stream gets chunked in the middle of an escape sequence
- Add support for PTY pseudo terminal HOT 1
- RangeError: Maximum call stack size exceeded HOT 1
- [Question] HTML to Text output HOT 3
- CVE-2021-23424L : ansi-html (0.0.7) Security Vulnerability issue HOT 2
- HOW_TO for Dummies
- Suggestion: Have CSS classes instead of styles
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 ansi-to-html.