Bug 458800

Summary: Line breaks in sent message get removed
Product: [Applications] NeoChat Reporter: Nate Graham <nate>
Component: GeneralAssignee: Tobias Fella <fella>
Status: RESOLVED FIXED    
Severity: normal CC: carl, james.h.graham
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Can't even

Description Nate Graham 2022-09-06 16:42:41 UTC
Git master everything KDE on top of Fedora 36.


STEPS TO REPRODUCE
Send the following message:

> BUG: can't
> 
> STEPS TO REPRODUCE
> try
> 
> ACTUAL RESULTS
> can't even
> 
> EXPECTED RESULTS
> be able to even
> 
> ADDITIONAL INFORMATION
> worked in the last version

OBSERVED RESULT
It gets sent as:

> BUG: can't STEPS TO REPRODUCE
> try ACTUAL RESULTS
> can't even EXPECTED RESULTS
> be able to even ADDITIONAL INFORMATION
> worked in the last version

EXPECTED RESULT
It gets sent exactly as I typed it, with the line breaks preserved


ADDITIONAL INFORMATION
It's not just a display bug, as Element shows the mangled message the same as NeoChat does. So the formatting is actually being lost before the message is sent, not just displayed incorrectly.
Comment 1 Nate Graham 2022-09-06 16:43:42 UTC
Created attachment 151872 [details]
Can't even
Comment 2 James Graham 2022-09-07 17:31:06 UTC
This is a known issue that will be fixed when https://invent.kde.org/network/neochat/-/merge_requests/492 gets merged. Basically we shouldn't be stripping the paragraph html tags in rich text as that is how multiple line breaks are handled.
Comment 3 James Graham 2022-10-18 19:09:40 UTC
Git commit 595ece81083e87d1f13325196dce96881f99f1eb by James Graham.
Committed on 18/10/2022 at 19:09.
Pushed by nvrwhere into branch 'master'.

Fix line breaks being removed

Stop stripping paragraph tags as this is causing line breaks to be removed in the formatted body. Any double new line in the plain text is treated as a paragraph in rich text.

M  +0    -2    src/actionshandler.cpp

https://invent.kde.org/network/neochat/commit/595ece81083e87d1f13325196dce96881f99f1eb