From 7bfa03a78ca1143bf11bafa89c1b9cf0c08c942b Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 10 Feb 2021 15:20:53 +0100 Subject: Add common message text sanitization. --- alot/widgets/thread.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'alot/widgets/thread.py') diff --git a/alot/widgets/thread.py b/alot/widgets/thread.py index 7d3bafca..90eeabdf 100644 --- a/alot/widgets/thread.py +++ b/alot/widgets/thread.py @@ -40,6 +40,8 @@ class MessageSummaryWidget(urwid.WidgetWrap): if date is not None: text += " (%s)" % date + text = text.translate(settings.sanitize_header_table) + cols = [urwid.Text(text)] if settings.get('msg_summary_hides_threadwide_tags'): @@ -288,6 +290,8 @@ class _TextPart(_MIMEPartWidget): self._fold_context = settings.get('thread_fold_context') + text = text.translate(settings.sanitize_text_table) + # try highlighting with pygments first hilit = self._highlight_pygments(text, part, attr_text) if hilit is None: @@ -562,6 +566,8 @@ class HeadersWidget(urwid.WidgetWrap): widgets = [] for key, value in headers: + value = value.translate(settings.sanitize_header_table) + # TODO even/odd keyw = ('fixed', max_key_len + 1, urwid.Text((self._key_attr, key))) -- cgit v1.2.3