Add a unit test for the workaround, and fix a bug

This commit is contained in:
Joe Rickerby
2022-12-04 19:08:47 +00:00
parent b00547cd97
commit ec878dc393
2 changed files with 37 additions and 3 deletions
+2 -2
View File
@@ -683,9 +683,9 @@ def fix_ansi_codes_for_github_actions(text: str) -> str:
ansi_codes: list[str] = []
output = ""
for line in text.split("\n"):
for line in text.splitlines(keepends=True):
# add the current ANSI codes to the beginning of the line
output += "".join(ansi_codes) + line + "\n"
output += "".join(ansi_codes) + line
# split the line at each ANSI code
parts = ansi_code_regex.split(line)