check if we're in colourless mode before passing back highlighted text.

pass context to check_mark so we can do the same there.

Fixes  rich.errors.MarkupError
This commit is contained in:
2025-06-22 01:57:58 +01:00
parent 4a0147aa8a
commit 922efddf7a
9 changed files with 18 additions and 14 deletions

View File

@@ -9,4 +9,6 @@ err = Console(stderr=True, style='bold red')
def highlight(ctx: typer.Context, text: str) -> str:
"""Highlight text using the current context's style."""
if ctx.obj['style'].name == 'no_colour':
return text
return f'[{ctx.obj["style"].highlight}]{text}[/{ctx.obj["style"].highlight}]'