Skip to content

Commit

Permalink
Escape newlines
Browse files Browse the repository at this point in the history
  • Loading branch information
desertaxle committed Dec 10, 2024
1 parent 9e2e1d2 commit 857cf3a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/pyright_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def format_markdown_table(diagnostics: list[Diagnostic]) -> str:
# Escape pipe characters in the message to prevent table formatting issues
message = diag.message.replace("|", "\\|")
location = f"L{diag.line}:{diag.character}"
table.append(f"| {diag.file} | {location} | {message} |")
table.append(f"| {diag.file} | {location} | {message.replace('\n', '\\n')} |")

return "\n".join(table)

Expand Down

0 comments on commit 857cf3a

Please sign in to comment.