Nullus157 / stylish-rs

Apache License 2.0
8 stars 2 forks source link

Don't apply style to empty strings #30

Closed Nemo157 closed 1 year ago

Nemo157 commented 1 year ago
[src/main.rs:2] stylish::ansi::format!("{:(fg=blue)}{:(fg=red)}{:(fg=blue)}", "foo", "", "bar")
  = "\u{1b}[34mfoo\u{1b}[31m\u{1b}[34mbar\u{1b}[0m"

There's no point in the \e[31\e[34 here.