Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emoji: First pass at support in Interactions #1129

Open
wants to merge 5 commits into
base: trunk
Choose a base branch
from

Conversation

obenland
Copy link
Member

@obenland obenland commented Jan 7, 2025

Heads up: This PR adds img tags to the list of allowed HTML tags for Interactions!
Should we sideload emoji images?

Fixes #970.

See https://mastodon.social/@obenland/113788023027390776
See https://obietester.blog/2025/01/06/99/#comment-31

Proposed changes:

  • Adds callback function that replaces custom emoji strings with their image representations when available.
  • Adds unit test to cover the new function.
  • Runs author name and comment content through the new callback on insert and update.

Other information:

  • Have you written new tests for your changes, if applicable?

Testing instructions:

  • Go to Mastodon, for example, and reply to a federated test post with a custom emoji. :yikes:, :AngeryCat:, etc.
  • Go to the comment list in wp-admin and make sure the emoji render as images.

@obenland obenland requested review from jeherve and a team January 7, 2025 17:32
@obenland obenland self-assigned this Jan 7, 2025
@pfefferle
Copy link
Member

I think before allowing images in comments, we have to think about/implement a proper blocking and moderation tooling (even more if it is about side-loading images): https://www.theverge.com/2023/7/24/23806093/mastodon-csam-study-decentralized-network

@obenland
Copy link
Member Author

I just pushed an update that moves the replacement into a filter that runs after comment_content and the author have been sanitized. That way, only custom emoji images will be added to the content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Federated comments: Fediverse handles including custom emoticons are displayed in plain text
2 participants