Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a decent ansi-to-html converter #82

Open
kristopolous opened this issue May 10, 2020 · 0 comments
Open

a decent ansi-to-html converter #82

kristopolous opened this issue May 10, 2020 · 0 comments
Milestone

Comments

@kristopolous
Copy link
Owner

so this an another aside. There's a bunch of these actually but they always have a one-pass approach. I don't want to finger point, you can find them yourself but basically they make a <style> as essentially a lookup table and then do a preg-replace of escape codes with spans or even worse do just inline css. Essentially you turn complex ansi graphics into a giant honking file that brings every mobile phone under $400 to their knees weeping.

Instead I want to do a multi-pass approach essentially using the true color gif hack. Basically you'll have about 20 spans preformatted, absolutely positioned in a container.

You do a pass essentially for 'background colors' which isn't background colors, it's a full-block unicode character https://www.fileformat.info/info/unicode/char/2588/index.htm with the text color set as the background.

Then on top of this you do the character colors, this is ignoring the blink, which you can certainly add. So essentially you get a bunch of spans layered on top of each other filling in the gaps of the other ones and hopefully hopefully hopefully the browser will not want to huff blue smoke over that (although it might just as well)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant