Coder Social home page Coder Social logo

Comments (4)

rburns avatar rburns commented on July 21, 2024

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.

mmmries avatar mmmries commented on July 21, 2024

@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.

rburns avatar rburns commented on July 21, 2024

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.

rburns avatar rburns commented on July 21, 2024

fixed with #7

from ansi-to-html.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.