pawamoy / failprint

Run a command, print its output only if it fails.
https://pawamoy.github.io/failprint
ISC License
7 stars 1 forks source link

Use Rich for markup #13

Closed pawamoy closed 1 year ago

pawamoy commented 1 year ago

Is your feature request related to a problem? Please describe. Ansimarkup (currently used) crashes when it encounters unknown markup tags (typically XML). I've opened an issue more than one year ago but didn't get feedback from the maintainer (https://github.com/gvalkov/python-ansimarkup/issues/17).

Describe the solution you'd like A solution would be to switch to Rich which provides an escape method: https://rich.readthedocs.io/en/stable/reference/markup.html#rich.markup.escape. It also uses [] instead of <> so would not have any problems with XML in the output.

Describe alternatives you've considered Implementing an escape function in Ansimarkup.

Additional context Rich would also allow much more rich (pun intended) formats.

pawamoy commented 1 year ago

There's an issue with the ANSI sequences used by mypy: https://github.com/Textualize/rich/issues/2688

pawamoy commented 1 year ago

I was able to fix the issue with ansimarkup, closing.