Comments (4)
That seems like a good idea. Is it something you'd expect to be more involved than running an htmlentities() function over all the text input? Do you think it should be optional (defualt enabled?, disabled?) or always on?
from ansi-to-html.
@rburns I am a total node newb so feel free to tell me what I am getting wrong here.
I don't see any sort of built-in html escaping stuff in javascript, so I looked through the packages on npm and entities looks like the most popular choice or doing html/xml encoding.
I think for a first pass of this feature it should be off by default and can be turned on by passing a flag like:
AnsiConverter = require 'ansi-to-html'
converter = new AnsiConverter({escapeHtml: true})
converter.toHtml(ansiString)
That way we don't change the existing behavior immediately, and then maybe on the next major release we can switch it to be on by default.
Thoughts?
from ansi-to-html.
yeah, I think that sounds about right. I can look into implementing it in the coming days. If you get to it first, that's ok too.
from ansi-to-html.
fixed with #7
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.