Coder Social home page Coder Social logo

inverse color is ignored about ansi-to-html HOT 3 OPEN

rburns avatar rburns commented on August 22, 2024
inverse color is ignored

from ansi-to-html.

Comments (3)

rburns avatar rburns commented on August 22, 2024

yeah, that sounds reasonable. Thanks for the example with screenshots.

from ansi-to-html.

MagicLegend avatar MagicLegend commented on August 22, 2024

I'd be interested in fixing this issue; but what would there need to be changed? @rburns could you point me in the right direction?

from ansi-to-html.

rburns avatar rburns commented on August 22, 2024

probably, start with a test as I've made here https://github.com/rburns/ansi-to-html/compare/inverse-color. the first, I think is roughly correct. It tests setting inverse colors. and an empty one, which would test clearing those values. the latter empty test might not be necessary, or may look something like these reset to default color tests https://github.com/rburns/ansi-to-html/blob/inverse-color/test/ansi_to_html.js#L192-L204 but handling a different escape code.

the test string is taken from the original post. I removed the trailing escape code. I'm not certain of it's functionality. it doesn't appear yet, in any of the tests.

implementation would start here https://github.com/rburns/ansi-to-html/blob/inverse-color/src/ansi_to_html.js#L152 adding a case for the inverse escape code, which calls pushForegroundColor() and pushBackgroundColor() appropriately. trying to get that test to pass, by adjusting it, or other related code. and then doing some research and seeing if there are escape codes not yet implemented which need to take care to reverse the operation.

It's also worth pointing out that either of these branches #57
and #55 may have some impact on this issue.

let me know if you run into any complications

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.