Skip to content
Myr

🐛 Fix printing HTML from Rich output (#1055)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sebastián Ramírez · committed by GitHub · parent 2f9ce51 · Browse files · 1 file+3 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−3 removed

  • other:+3 added−3 removed

1 file+3 added−3 removed

modified:typer/rich_utils.py+3 added-3 removed
1# Extracted and modified from https://github.com/ewels/rich-click23import inspect4import io5import sys6from collections import defaultdict7from gettext import gettext as _8from os import getenv
708 unmodified lines
717718 This function does not provide a full HTML page, but can be used to insert719 HTML-formatted text spans into a markdown file.720 """720 console = Console(record=True, highlight=False)721 console = Console(record=True, highlight=False, file=io.StringIO())722722 with console.capture():723 console.print(input_text, overflow="ignore", crop=False)723 console.print(input_text, overflow="ignore", crop=False)724725 return console.export_html(inline_styles=True, code_format="{code}").strip()