Skip to content

Commit 1050377

Browse files
committed
docs: try to fix colors
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 36de762 commit 1050377

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

docs/main.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ def subprocess_run(*args: str) -> str:
2121
env["PYTHON_COLORS"] = "1"
2222
output = subprocess.run(args, check=True, capture_output=True, text=True, env=env).stdout
2323
rich_text = rich.text.Text.from_ansi(output)
24-
console = rich.console.Console(record=True)
25-
console.print(rich_text)
24+
console = rich.console.Console(record=True, force_terminal=True)
25+
console.out(rich_text)
2626
page = console.export_html(inline_styles=True)
27-
text = re.search(r"<body.*?>(.*?)</body>", page, re.DOTALL | re.IGNORECASE).group(1)
28-
return text.strip()
27+
result = re.search(r"<body.*?>(.*?)</body>", page, re.DOTALL | re.IGNORECASE)
28+
assert result
29+
return result.group(1).strip()

0 commit comments

Comments
 (0)