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

href field of the user mention <a> tag is encoded #1917

Closed
North-West-Wind opened this issue Aug 30, 2024 · 0 comments · Fixed by #1936
Closed

href field of the user mention <a> tag is encoded #1917

North-West-Wind opened this issue Aug 30, 2024 · 0 comments · Fixed by #1936

Comments

@North-West-Wind
Copy link

Describe the bug

When mentioning a user in Cinny, the produced href in the <a> tag of formatted_body is encoded. It's not the case of other clients, such as SchildiChat and FluffyChat.

Cinny message source { "type": "m.room.message", "sender": "@northwestwind:matrix.northwestw.in", "content": { "msgtype": "m.text", "body": "@discord_895321877109690419:matrix.northwestw.in", "format": "org.matrix.custom.html", "formatted_body": "<a href=\"https%3A%2F%2Fmatrix.to%2F%23%2F%40discord_895321877109690419%3Amatrix.northwestw.in\">@TradeW1nd (bot)</a>" }, "origin_server_ts": 1725023942435, "unsigned": { "membership": "join", "age": 62, "transaction_id": "m1725023942287.7" }, "event_id": "hidden", "room_id": "!hidden:matrix.northwestw.in" }
FluffyChat message source { "type": "m.room.message", "sender": "@northwestwind:matrix.northwestw.in", "content": { "msgtype": "m.text", "body": "@[TradeW1nd (bot)] ", "format": "org.matrix.custom.html", "formatted_body": "<a href=\"https://matrix.to/#/@discord_895321877109690419:matrix.northwestw.in\">@[TradeW1nd (bot)]</a>" }, "origin_server_ts": 1725024749022, "unsigned": { "membership": "join", "age": 128 }, "event_id": "hidden", "room_id": "!hiddenmatrix.northwestw.in" }

This causes issues with bridges, Mautrix bridges in particular. They get confused and just show the encoded URI.
image

Reproduction

  1. Set up a Mautrix bridge
  2. Send a message mentioning a user
  3. The encoded URI gets shown on the non-matrix platform

Expected behavior

The <a> tag in formatted_body should not be URI encoded.

Platform and versions

1. OS: Endeavour OS
2. Browser: Firefox 129.0.2
3. Cinny: v4.1.0
4. Homeserver: matrix.northwestw.in

Additional context

Not sure if this is an intentional design or not. If so, I shall report this to the bridges.

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

Successfully merging a pull request may close this issue.

1 participant