Bug 492738 - Several consecutive newlines are ignored in messages
Summary: Several consecutive newlines are ignored in messages
Status: RESOLVED INTENTIONAL
Alias: None
Product: NeoChat
Classification: Applications
Component: General (show other bugs)
Version: 24.08.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Tobias Fella
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-07 03:16 UTC by Claire
Modified: 2024-09-12 12:48 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Example Render (6.73 KB, image/png)
2024-09-10 15:19 UTC, James Graham
Details
Example screen recording reproducing the bug (426.12 KB, video/mp4)
2024-09-11 04:41 UTC, Claire
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Claire 2024-09-07 03:16:30 UTC
SUMMARY
Several consecutive newlines are collapsed into one

STEPS TO REPRODUCE
1. Send the following message:
```
a
b

c
```

OBSERVED RESULT
The message is rendered as:
```
a
b
c
```

EXPECTED RESULT
The message should've been rendered as:
```
a
b

c
```

SOFTWARE/OS VERSIONS
KDE Frameworks Version: 6.5.0
Qt Version: 6.7.2

ADDITIONAL INFORMATION
Interestingly, right-clicking on the message shows the following context menu item:
```
Search for 'a

b
c'
```

nheko renders the message as intended (see EXPECTED RESULT), but Element Android renders it as:
```
a

b


c
```
Comment 1 James Graham 2024-09-10 15:19:21 UTC
Created attachment 173531 [details]
Example Render

So the linebreaks are retained just fine for me.

This is the generated rich text by the way:
<pre><code>a\nb\n\nc\n</code></pre>
Comment 2 James Graham 2024-09-10 15:20:00 UTC
Can you elaborate more on what you are seeing
Comment 3 Claire 2024-09-11 04:38:50 UTC
Oops, sorry for the lack of clarity. _Don't_ do the backticks--I typed them to clarify what I typed out. I'll upload a screen recording if that helps.
Comment 4 Claire 2024-09-11 04:41:25 UTC
Created attachment 173547 [details]
Example screen recording reproducing the bug
Comment 5 James Graham 2024-09-12 12:48:09 UTC
So this is as per the cmark spec for converting markdown to html. Multiple line breaks just create paras and the excess breaks are lost.