Fix HTML entity decoding when editing Mastodon posts (#893)

This commit is contained in:
2026-01-21 08:44:13 -06:00
parent 7c131b6936
commit 320c7a361c
2 changed files with 4 additions and 5 deletions

View File

@@ -4,6 +4,8 @@ TWBlue Changelog
* Core: * Core:
* Expanded the keystroke editor actions list. Now, many previously hidden or unassignable actions are available to be mapped to custom keyboard shortcuts. * 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 ## Changes in version 2026.01.13

View File

@@ -10,7 +10,7 @@ import languageHandler
from twitter_text import parse_tweet, config from twitter_text import parse_tweet, config
from mastodon import MastodonError from mastodon import MastodonError
from controller import messages from controller import messages
from sessions.mastodon import templates from sessions.mastodon import templates, utils
from wxUI.dialogs.mastodon import postDialogs from wxUI.dialogs.mastodon import postDialogs
from extra.autocompletionUsers import completion from extra.autocompletionUsers import completion
from . import userList from . import userList
@@ -282,10 +282,7 @@ class editPost(post):
# Extract text from post # Extract text from post
if item.reblog != None: if item.reblog != None:
item = item.reblog item = item.reblog
text = item.content text = utils.html_filter(item.content)
# Remove HTML tags from content
import re
text = re.sub('<[^<]+?>', '', text)
# Initialize parent class # Initialize parent class
super(editPost, self).__init__(session, title, caption, text=text, *args, **kwargs) super(editPost, self).__init__(session, title, caption, text=text, *args, **kwargs)
# Store the post ID for editing # Store the post ID for editing