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

spaced text when multiple rows

Open Destinyg133 opened this issue 4 months ago • 5 comments

Steps to reproduce

Same issue as on android https://github.com/element-hq/element-x-android/issues/4695

Render is off, its spaced and its annoying. Rendering works normally on EW

Outcome

What did you expect?

Render to work properly, not to have extra spaces inbetween

What happened instead?

Space, rendering not working...

Your phone model

No response

Operating system version

No response

Application version

28.08.03

Homeserver

No response

Will you send logs?

No

Destinyg133 avatar Aug 22 '25 04:08 Destinyg133

25.03.0 was still working fine

Image

But in newest version its like this:

Image

Destinyg133 avatar Aug 30 '25 05:08 Destinyg133

Seems to be an issue of the markdown parser the SDK uses.

Velin92 avatar Sep 01 '25 09:09 Velin92

Seems to be an issue of the markdown parser the SDK uses.

Is the issue already raised for sdk? Is it maybe tracked somewhere? Thank you

Destinyg133 avatar Sep 26 '25 07:09 Destinyg133

@Destinyg133 hey, I have 2 requests.

  1. Can you test out version 25.09.12?

  2. Could you provide text that you used in messages? Format them like you will in Element X:

Wordle 1,532 2/6

🟩⬜🟨⬜🟩
🟩🟩🟩🟩🟩

In Ruma tests, it will look like this:

Wordle 1,532 2/6\n\n🟩⬜🟨⬜🟩\n🟩🟩🟩🟩🟩

And Ruma produces the following output:

<p>Wordle 1,532 2/6</p>\n<p>🟩⬜🟨⬜🟩<br />\n🟩🟩🟩🟩🟩</p>\n

After some quick testing with Ruma – SDK that is being used in this Matrix client – it seems to handle multi-line messages with emojis just fine.

However, there are some hacks around Ruma's behavior that might produce different result:

https://github.com/element-hq/element-x-ios/blob/efa06b31d8cbd248577cf942f958dbbd0526cb2c/ElementX/Sources/Other/HTMLParsing/AttributedStringBuilderV2.swift#L421C1-L432C2

Which were added in the following PR (already present in version 25.09.12): https://github.com/element-hq/element-x-ios/pull/4506


Mentioning issue https://github.com/element-hq/element-x-android/issues/4695 as related one.

hugmouse avatar Oct 08 '25 07:10 hugmouse

@Destinyg133 hey, I have 2 requests.

1. Can you test out version 25.09.12?

2. Could you provide text that you used in messages? Format them like you will in Element X:
Wordle 1,532 2/6

🟩⬜🟨⬜🟩
🟩🟩🟩🟩🟩

In Ruma tests, it will look like this:

Wordle 1,532 2/6\n\n🟩⬜🟨⬜🟩\n🟩🟩🟩🟩🟩

And Ruma produces the following output:

<p>Wordle 1,532 2/6</p>\n<p>🟩⬜🟨⬜🟩<br />\n🟩🟩🟩🟩🟩</p>\n

After some quick testing with Ruma – SDK that is being used in this Matrix client – it seems to handle multi-line messages with emojis just fine.

However, there are some hacks around Ruma's behavior that might produce different result:

https://github.com/element-hq/element-x-ios/blob/efa06b31d8cbd248577cf942f958dbbd0526cb2c/ElementX/Sources/Other/HTMLParsing/AttributedStringBuilderV2.swift#L421C1-L432C2

Which were added in the following PR (already present in version 25.09.12): #4506

Mentioning issue element-hq/element-x-android#4695 as related one.

Still not working correctly

` Wordle 1,572 3/6

ā¬›šŸŸØā¬›ā¬›šŸŸ© ā¬›šŸŸØā¬›šŸŸØā¬› 🟩🟩🟩🟩🟩 `

Image

Destinyg133 avatar Oct 08 '25 14:10 Destinyg133