ratatui / ansi-to-tui

Convert ansi colored text to tui::text::Text
https://crates.io/crates/ansi-to-tui
MIT License
57 stars 21 forks source link

Test with assertions #14

Closed sayanarijit closed 2 years ago

sayanarijit commented 2 years ago

Tests with assertions and some hacky workaround for an old bug.

sayanarijit commented 2 years ago

@uttarayan21 only one test is failing. I'll probably need your help here.

uttarayan21 commented 2 years ago

Seems like a bug in the parse logic, I wrote most of the logic on a single night so its gotten pretty convoluted. I'm thinking of using nom parsers to rewrite the logic but thats going to take a while since I'm learning how to use that.

sayanarijit commented 2 years ago

~Or maybe use something like this https://docs.rs/ansi-parser ?~

Nevermind, nom seems to be a better choice here.

uttarayan21 commented 2 years ago

Yeah I already looked into that crate when making this one but that doesn't handle colors and seems mostly for a live terminal instead of text.

sayanarijit commented 2 years ago

I made it work with some hacky workaround, which I think should be fine, until we learn proper parsing.

sayanarijit commented 2 years ago

Forgot to remove main. Pushed again.

sayanarijit commented 2 years ago

@uttarayan21 could you have a a look?