-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Description
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.
Metadata
Metadata
Assignees
Labels
No labels