Support to display a limited set of HTML tags, aligned with Mastodon 4.2 #404
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is essentially a rewrite of the closed PR #348 using @AnonymouX47 's
TextEmbed
widget fromurwidgets
. It does not suffer from the rendering issue that caused problems for the previous PR, that usedurwid.Text
. As a bonus, it includes support for clickable links on terminals that support OCS 8 hyperlinks.If
urwidgets
library is not available, we fall back seamlessly to using urwid.Text and everything works as normal, you just don't get clickable links on terminals that support OCS 8 hyperlinks.This PR renders all HTML elements, and some HTML attributes, that are supported in Mastodon 4.2 spec
As part of this PR, the "highlight followed hashtags" feature is removed from the TUI (it remains in the console.)
Hashtags are hyperlinks with a class of "hashtag" or "mention hashtag", so they are rendered as hyperlinks (and are clickable if OCS 8 support is available in the terminal). Hashtag hyperlinks are rendered in light cyan.
HTML Status on a glitch-soc server
The same status on the TUI with this PR
As the
urwidgets
dependency is Python 3.7+, I have removed the Python 3.6 automated Github tests.