HTML-to-markup conversion for status output to console/clipboard

This introduces a dependency on html2text. The library works
well for our limited use cases, but has not been updated since
2020.
This commit is contained in:
Daniel Schwarz 2023-05-25 20:03:36 -04:00
parent bd375de357
commit 93a5306ff5
2 changed files with 2 additions and 0 deletions

View File

@ -277,6 +277,7 @@ def print_status(status, width):
h2t.wrap_links = True
h2t.wrap_list_items = True
h2t.wrap_tables = True
h2t.unicode_snob = True
h2t.ul_item_mark = "\N{bullet}"
text_status = h2t.handle(content).strip()

View File

@ -624,6 +624,7 @@ class TUI(urwid.Frame):
h2t.body_width = 0 # nowrap
h2t.single_line_break = True
h2t.ignore_links = True
h2t.unicode_snob = True
h2t.ul_item_mark = "\N{bullet}"
time = parse_datetime(status.original.data['created_at'])