element-hq / element-hq/element-android
Composer: text looses formatting after editing a markdown message or editing a reply message
- Dominant language
- Kotlin
- Stars
- 3.7k
- Forks
- 917
- PR merge metrics
- No merged PRs in 30d
Description
### Steps to reproduce
#### wrong formatting when editing a message:
1. enable markdown messages
2. send any message, e.g.
```md
# test
> foo
```
3. the message is sent correctly
4. edit the message - the message is rendered in the composer like in the chat (with big header and a cite) but the formatting marks are missing.
in my case i just added a `/n/n´bar´` (i was not able to break/ exit the comment either)
5. submit message
6. the new edited message is (without the cite):
> test <- not a header
>
> foo <- not a cite
>
> `bar` <- that works because i added the formatting marks
if you add the formatting marks manually before submitting the edit, the message is sent correctly.

#### duplicate `in reply to …`:
when replying to any message and editing the reply the same bug occures:
1. markdown can be enabled but it is not required
2. send any message
3. reply to that message with any message
4. edit the repy - the message is rendered with the
> > in reply to @…
> \*initial message\*
>
> \*reply message\*
which is applied to the message after submitting the edit draft.
5. the edited message is:
> > in reply to @…
> > \*initial message\*
>
> in reply to @…
> \*initial message\*
>
> \*reply message\*

there might be much more bugs when editing messages i haven't found.
### Outcome
#### What did you expect?
the message is rendered correctly
#### What happened instead?
i believe the problem is that the rendered message text is put into the composer instead of the raw message text so all formatting of the message gets lost when editing
### Your phone model
OnePlus 5T
### Operating system version
Android 10
### Application version and app store
Element version v1.6.5 from Google Play
### Homeserver
Synapse v1.89.0
### Will you send logs?
No
### Are you willing to provide a PR?
No
Contributor guide
Assessment
This issue has not been assessed yet.