Skip to content

Commit 95bf55d

Browse files
authored
fix: Escape error message to prevent MarkupError (#22)
1 parent aaff302 commit 95bf55d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/git_scribe/commands/commit.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,10 @@ def commit(ctx: typer.Context):
9494
git_utils.commit(commit_msg, passthrough_args)
9595
console.print("[bold green]Successfully committed.[/bold green]")
9696
except Exception as e:
97-
# Print the error message safely by passing it as a separate argument
98-
console.print("[bold red]Failed to commit:[/bold red]", e)
97+
from rich.markup import escape
98+
99+
error_message = escape(str(e))
100+
console.print("[bold red]Failed to commit:[/bold red]", error_message)
99101
raise typer.Exit(1)
100102
break
101103
elif action == "e":

0 commit comments

Comments
 (0)