Giter Club home page Giter Club logo

Comments (9)

wookayin avatar wookayin commented on June 12, 2024 1

A 3-year-old bug still not resolved? :(

from ansi2html.

szepeviktor avatar szepeviktor commented on June 12, 2024

And please add this to pre's style to break long lines:

    white-space: pre-wrap;
    word-wrap: break-word;

from ansi2html.

ralphbean avatar ralphbean commented on June 12, 2024

And please add this to pre's style to break long lines:

This would be an easy pull-request. Would you like to be the one to add it?

from ansi2html.

szepeviktor avatar szepeviktor commented on June 12, 2024

Please handle tput sgr0: revert back the current schema's color OR tell me how to reset that your script understands.

from ansi2html.

szepeviktor avatar szepeviktor commented on June 12, 2024

http://manpages.ubuntu.com/manpages/hardy/man5/terminfo.5.html

s0ds         s0        Shift to codeset 0 (EUC set 0, ASCII)
...
s0ds=\E(B

So \E(B is "Shift to codeset 0". I do not know what it is.
I'd like to just "turn off all attributes" by tput.

from ansi2html.

ralphbean avatar ralphbean commented on June 12, 2024

I'll take a look at handling sgr0 when I can. It seems like it would need to close as many </span> tags as had been opened.

from ansi2html.

szepeviktor avatar szepeviktor commented on June 12, 2024

Very dirty.

cat "${HC_LOG}.txt" \
    | ansi2html --title="$HC_DOMAIN" --linkify --font-size=13px --light-background -s xterm \
    | sed 's/\x1B(B\b//g' > "${HC_LOG}.html"

from ansi2html.

hartwork avatar hartwork commented on June 12, 2024

And please add this to pre's style to break long lines:

    white-space: pre-wrap;
    word-wrap: break-word;

That was added in 2014 for release 1.0.7 by commit 418bef2 .

from ansi2html.

hartwork avatar hartwork commented on June 12, 2024

Could you please handle reset?

# tput sgr0|hexdump  -C
00000000  1b 28 42 1b 5b 6d                                 |.(B.[m|

I'm unsure about how that^^ sgr0 differs from \x1b[0m (Wikipedia) semantically (if so). The latter is supported…

# hexdump -C <<<$'\x1b[0m'
00000000  1b 5b 30 6d 0a                                    |.[0m.|
00000005

# echo $'\x1b[31mhello red\x1b[0m and hello normal' | ansi2html --inline
<span style="color: #aa0000">hello red</span> and hello normal

…since 2013 release 0.10.0 commit fce66a6.

from ansi2html.

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.