element-x-ios icon indicating copy to clipboard operation
element-x-ios copied to clipboard

Messages with html paragraph tags around headings render with large amount of additional padding

Open marwing opened this issue 1 year ago • 0 comments

Steps to reproduce

This is a synthetic reproduction:

  1. Send a message from Element Web using /html <p><h2>Test</h2></p>Some text
  2. View that message in Element X

This issue is not limited to h2.

The real events that triggered me writing this issue are sent by an RSS maubot following the GitHub releases feed for the sliding sync proxy with a template that contains the summary. One of these events is shown in the details below.

I don't know if any user facing matrix chat clients ever produce html like this (without forcing it like above), so if you don't see this as relevant for the intended use case, feel free to close this issue.

Outcome

Actual Expected
IMG_0163 IMG_0162
(or similar)
The real world event
Actual Expected
IMG_0161 IMG_3744 IMG_0164 IMG_3746
(or similar)

Element Web doesn't render this much space: EW Neither does FluffyChat: IMG_3747

And the source just in case it is helpful:

{
  ...
  "type": "m.room.message",
  "content": {
    "msgtype": "m.notice",
    "body": "New post in Release notes from sliding-sync: v0.99.15 (https://github.com/matrix-org/sliding-sync/releases/tag/v0.99.15)\n\n## Bug fixes\n\n● Fixed an issue which would cause metadata about a space child room to be erroneously sent to active connections, even if they weren't in the room. This did not leak any information that the client was not already authorised to see via the `/hierarchy` endpoint. This would appear in Element X as a new room in the room list with a room name and avatar, but no timeline history. Restarting Element X would remove the room.\n● Fixed an issue where the `avatar` field would be set to the other user even if the room was not a DM room.\n## What's Changed\n● bugfix: ensure metadata about space children doesn't leak to active connections by @kegsay (https://github.com/kegsay) in #392 (https://github.com/matrix-org/sliding-sync/pull/392)\n● Only emit avatars when DM room is set by @kegsay (https://github.com/kegsay) in #394 (https://github.com/matrix-org/sliding-sync/pull/394)\n**Full Changelog**: v0.99.14...v0.99.15 (https://github.com/matrix-org/sliding-sync/compare/v0.99.14...v0.99.15)",
    "format": "org.matrix.custom.html",
    "formatted_body": "<p>New post in Release notes from sliding-sync: <a href=\"https://github.com/matrix-org/sliding-sync/releases/tag/v0.99.15\">v0.99.15</a></p>\n<p><h2>Bug fixes</h2></p>\n<ul>\n<li>Fixed an issue which would cause metadata about a space child room to be erroneously sent to active connections, even if they weren't in the room. This did not leak any information that the client was not already authorised to see via the <code>/hierarchy</code> endpoint. This would appear in Element X as a new room in the room list with a room name and avatar, but no timeline history. Restarting Element X would remove the room.</li>\n<li>Fixed an issue where the <code>avatar</code> field would be set to the other user even if the room was not a DM room.</li>\n</ul>\n<h2>What's Changed</h2>\n<ul>\n<li>bugfix: ensure metadata about space children doesn't leak to active connections by <a class=\"user-mention notranslate\" href=\"https://github.com/kegsay\">@kegsay</a> in <a class=\"issue-link js-issue-link\" href=\"https://github.com/matrix-org/sliding-sync/pull/392\">#392</a></li>\n<li>Only emit avatars when DM room is set by <a class=\"user-mention notranslate\" href=\"https://github.com/kegsay\">@kegsay</a> in <a class=\"issue-link js-issue-link\" href=\"https://github.com/matrix-org/sliding-sync/pull/394\">#394</a></li>\n</ul>\n<p><strong>Full Changelog</strong>: <a class=\"commit-link\" href=\"https://github.com/matrix-org/sliding-sync/compare/v0.99.14...v0.99.15\"><tt>v0.99.14...v0.99.15</tt></a></p>\n"
  }
}

Your phone model

iPhone 13 mini / iPad Pro

Operating system version

iOS/iPadOS 17.4

Application version

1.5.10 (94)

Homeserver

Synapse 1.102.0 / Proxy 0.99.15

Will you send logs?

No

marwing avatar Mar 08 '24 20:03 marwing