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

Rich text editor sends HTML in plaintext body when mentioning users #28516

Open
tadzik opened this issue Nov 21, 2024 · 0 comments
Open

Rich text editor sends HTML in plaintext body when mentioning users #28516

tadzik opened this issue Nov 21, 2024 · 0 comments
Labels
A-Rich-Text-Editor Issues with the new rich text editor, also known as the WYSIWYG editor O-Occasional Affects or can be seen by some users regularly or most users rarely S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect Z-Labs

Comments

@tadzik
Copy link

tadzik commented Nov 21, 2024

Steps to reproduce

  1. Enable devtools and the rich text editor
  2. Mention someone in a chat
  3. Check the Matrix event that was sent

Outcome

What did you expect?

An event that has a plaintext and a formatted body. That's how it looks for non-RTE:

"content": {
    "msgtype": "m.text",
    "body": "tadzik: hi",
    "format": "org.matrix.custom.html",
    "formatted_body": "<a href=\"https://matrix.to/#/@irc_tadzik:home.tadzik.net\">tadzik</a>: hi",
    "m.mentions": {
      "user_ids": [
        "@irc_tadzik:home.tadzik.net"
      ]
    }
  },

What happened instead?

The event sent contains HTML in both body and formatted_body:

{
    "msgtype": "m.text",
    "body": "<a data-mention-type=\"user\" href=\"https://matrix.to/#/@irc_tadzik:home.tadzik.net\" contenteditable=\"false\">tadzik</a> hi",
    "format": "org.matrix.custom.html",
    "formatted_body": "<a href=\"https://matrix.to/#/@irc_tadzik:home.tadzik.net\">tadzik</a> hi"
  }

Operating system

Debian Linux

Browser information

Firefox 128 ESR

URL for webapp

app.element.io

Application version

Element version: 1.11.86 Crypto version: Rust SDK 0.7.2 (517d99b), Vodozemac 0.7.0

Homeserver

Synapse v1.114.0

Will you send logs?

No

@dosubot dosubot bot added A-Rich-Text-Editor Issues with the new rich text editor, also known as the WYSIWYG editor O-Occasional Affects or can be seen by some users regularly or most users rarely S-Minor Impairs non-critical functionality or suitable workarounds exist labels Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rich-Text-Editor Issues with the new rich text editor, also known as the WYSIWYG editor O-Occasional Affects or can be seen by some users regularly or most users rarely S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect Z-Labs
Projects
None yet
Development

No branches or pull requests

1 participant