element-hq / element-hq/element-web

Line breaks are lost when editing a message containing markdown

Open
#33,032 0 comments 2 reactions 0 assignees View on GitHub
A-Markdown A-Message-Editing O-Occasional S-Minor T-Defect
Dominant language
TypeScript
Stars
13.5k
Forks
2.8k
PR merge metrics
PR metrics pending

Description

### Steps to reproduce

When you have a `_` or any markdown character (like `<`) in a message and edit the message, it will add a backslash, then the renderer will parse it as a plain text, and ignore breaklines.
Example:
```
blabla/_test
https://test.com/
```

### Outcome

#### What did you expect?
Breaklines need to be kept after editing.

#### What happened instead?
first message without editing
second message with editing
Image

I think the fix is in Markdown.ts:toPlainText()
It would need something like:
```
renderer.softbreak = function () {
this.lit("\n");
};
```

### Operating system

_No response_

### Application version

_No response_

### How did you install the app?

_No response_

### Homeserver

_No response_

### Will you send logs?

No

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.