1
0
mirror of https://github.com/ihabunek/toot synced 2024-12-23 23:52:40 +01:00
Toot-Mastodon-CLI-TUI-clien.../toot/tui/urwidgets.py
Daniel Schwarz 0f39b1087f Support to display a limited set of HTML tags
HTML tag support is aligned with Mastodon 4.2 supported tags.
This code introduces a soft dependency on the urwidgets library.
If urwidgets is not available, HTML tags are still supported,
but hyperlinks are not underlined using the OCS 8 terminal
feature (on supported terminals).
2023-09-22 21:32:19 -04:00

9 lines
331 B
Python

# If urwidgets is loaded use it; otherwise use our stubs
try:
from urwidgets import Hyperlink, TextEmbed, parse_text # noqa: F401
has_urwidgets = True
except ImportError:
from .stub_hyperlink import Hyperlink # noqa: F401
from .stub_text_embed import TextEmbed, parse_text # noqa: F401
has_urwidgets = False