Thanks for the nifty package, it's very cool! I'd love to be able to use it with Colored, but using coloured text in a table breaks the layout:
use colored::Colorize;
use termimad::{MadSkin};
fn main() {
let header = "|:-|:-\n|**Example**|**Table**|\n|-|-";
let col1 = "Colourful text".bright_red();
let col2 = "breaks the table :(".bold();
let rest = format!("| {col1} | {col2} |");
let table = format!("{header}\n{rest}\n|-");
MadSkin::default().print_text(&table);
}
$ cargo run
┌───────────────────────┬───────────────────────────┐
│Example │Table │
├───────────────────────┼───────────────────────────┤
│Colourful text│breaks the table :(│
└───────────────────────┴───────────────────────────┘
My guess is it's counting escape codes when it shouldn't.
Thanks for the nifty package, it's very cool! I'd love to be able to use it with Colored, but using coloured text in a table breaks the layout:
My guess is it's counting escape codes when it shouldn't.