From ce4cdac0f12ae32b9ea8b820db21b9be0b415f62 Mon Sep 17 00:00:00 2001 From: Quratulain-bilal Date: Wed, 29 Jul 2026 12:28:48 +0500 Subject: [PATCH] fix: escape Rich markup in workflow error output Escape user-controlled exception text with _escape_markup() to prevent Rich from interpreting square brackets as markup tags, which could corrupt output or raise MarkupError. Matches the pattern used in workflow_resume and all other err.print() calls in this file. --- src/specify_cli/workflows/_commands.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/specify_cli/workflows/_commands.py b/src/specify_cli/workflows/_commands.py index 86076f4604..0ca0d047e5 100644 --- a/src/specify_cli/workflows/_commands.py +++ b/src/specify_cli/workflows/_commands.py @@ -1141,10 +1141,10 @@ def workflow_run( ), ) except ValueError as exc: - err.print(f"[red]Error:[/red] {exc}") + err.print(f"[red]Error:[/red] {_escape_markup(str(exc))}") raise typer.Exit(1) except Exception as exc: - err.print(f"[red]Workflow failed:[/red] {exc}") + err.print(f"[red]Workflow failed:[/red] {_escape_markup(str(exc))}") raise typer.Exit(1) if json_output: