From 320c7a361cf82b76bae6f564fb801e455e030eb8 Mon Sep 17 00:00:00 2001 From: Manuel cortez Date: Wed, 21 Jan 2026 08:44:13 -0600 Subject: [PATCH] Fix HTML entity decoding when editing Mastodon posts (#893) --- doc/changelog.md | 2 ++ src/controller/mastodon/messages.py | 7 ++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/doc/changelog.md b/doc/changelog.md index 508fbc44..72875542 100644 --- a/doc/changelog.md +++ b/doc/changelog.md @@ -4,6 +4,8 @@ TWBlue Changelog * Core: * Expanded the keystroke editor actions list. Now, many previously hidden or unassignable actions are available to be mapped to custom keyboard shortcuts. +* Mastodon: + * Fixed an issue where HTML entities were not decoded when editing a post. ([#893](https://github.com/mcv-software/twblue/issues/893)) ## Changes in version 2026.01.13 diff --git a/src/controller/mastodon/messages.py b/src/controller/mastodon/messages.py index 48b2b678..63c6a7da 100644 --- a/src/controller/mastodon/messages.py +++ b/src/controller/mastodon/messages.py @@ -10,7 +10,7 @@ import languageHandler from twitter_text import parse_tweet, config from mastodon import MastodonError from controller import messages -from sessions.mastodon import templates +from sessions.mastodon import templates, utils from wxUI.dialogs.mastodon import postDialogs from extra.autocompletionUsers import completion from . import userList @@ -282,10 +282,7 @@ class editPost(post): # Extract text from post if item.reblog != None: item = item.reblog - text = item.content - # Remove HTML tags from content - import re - text = re.sub('<[^<]+?>', '', text) + text = utils.html_filter(item.content) # Initialize parent class super(editPost, self).__init__(session, title, caption, text=text, *args, **kwargs) # Store the post ID for editing