Bug 455016

Summary: Editing edited messages with markdown causes markdown elements to be replaced with html elements in chat box
Product: [Applications] NeoChat Reporter: Jan Bidler <janbidler00>
Component: GeneralAssignee: Tobias Fella <fella>
Status: RESOLVED FIXED    
Severity: normal CC: carl
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: All   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Jan Bidler 2022-06-08 08:54:50 UTC
SUMMARY
Trying to edit an edited markdown message will result in the preview chat box having all markdown elements being replaced with html elements, making the edit much harder.


STEPS TO REPRODUCE
1. Send any message (i.e. `foo`)
2. Edit said message and insert markdown into it (i.e. `*foo*`)
3. Edit said message again

OBSERVED RESULT
The markdown elements will be replaced with html elements (i.e the `*foo*` from above will turn into `<em>foo</em>`) which when send get interpreted as plaintext.

EXPECTED RESULT
The markdown elements should be kept as markdown elements.

SOFTWARE/OS VERSIONS
Windows: 10 21H1
NeoChat Version: 22.04
KDE Frameworks Version: 5.94.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
This only seems to appear if I either use the "up-arrow" option to edit a message, or right click -> edit. The "edit" button at the right of the message does not seem to cause this.
Comment 1 Bug Janitor Service 2022-06-12 15:18:42 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/neochat/-/merge_requests/462
Comment 2 Tobias Fella 2022-06-14 13:47:18 UTC
Git commit 9c2e0669f6ac1783f289b7148fabe232dd10ea59 by Tobias Fella, on behalf of James Graham.
Committed on 14/06/2022 at 13:47.
Pushed by tfella into branch 'master'.

Fixe Reply or Edit from Chatbar

Fixes it so that the cleaned text is shown when using the shortcuts to reply or edit from the chatbar. Also ensures that the correct eventids are passed when the message is an edit.

This also fixes the issue of having html pasted into the chatbar when editing and edit.

Fixes network/neochat#448

M  +2    -2    imports/NeoChat/Page/RoomPage.qml
M  +26   -26   src/messageeventmodel.cpp

https://invent.kde.org/network/neochat/commit/9c2e0669f6ac1783f289b7148fabe232dd10ea59