eeve / ascii_table

Easy table output for deno debugging, but you could probably do more with it, since its just a string.
Other
11 stars 2 forks source link

colors mess with sizing #2

Open CanRau opened 2 years ago

CanRau commented 2 years ago

Hey, just stumbled upon this module trying to beautify a "todo" table my CLI generates When I tried colorizing certain lines I notices that the output, especially header, is pretty messed up Then I realized, that https://deno.land/std@0.110.0/fmt/colors.ts of course wraps the string with control characters which then "pollute" string measuring, because they later won't show up.

Not sure if you're interested in supporting this? Would be cool though 😇

vicary commented 2 years ago

Should be easily done with import { stripColors } from "colors.ts"; when calculating length.