Bug 492738

Summary: Several consecutive newlines are ignored in messages
Product: [Applications] NeoChat Reporter: Claire <misc>
Component: GeneralAssignee: Tobias Fella <fella>
Status: RESOLVED INTENTIONAL    
Severity: normal CC: carl, james.h.graham
Priority: NOR    
Version: 24.08.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Example Render
Example screen recording reproducing the 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.