element-hq / element-hq/element-web

HTML <br /> injected as readable text

Open
#28,602 4 comments 0 reactions 0 assignees View on GitHub
A-Markdown O-Occasional S-Major T-Defect X-Regression
Dominant language
TypeScript
Stars
13.5k
Forks
2.8k
PR merge metrics
PR metrics pending

Description

Element does not convert `\n` characters to `
` (#25891), so to reliably send messages that'd properly render on all clients, markdown newline syntax has to be used explicitly. Recently, however, that started to result in **readable** `
` being injected instead.

### Only messages with `\` character are affected, since that forces them into html mode. (#25891)

Example message:
```
line \* 1
line 2
```
(note the two spaces a the end of the first line, which is Markdown syntax for a newline)

The message above used to result in formatted_body that looked like
### `line * 1
\nline 2`
and rendered as
```
line * 1
line 2
```
on all clients.

Now, however, attempting do that injects `
` as **readable** text.

That is, formatted_body looks like
### `line * 1<br />\nline 2`
and the message renders as
```
line * 1
line 2
```
on all clients, including Element.

Essentially, it is now **entirely impossible** to send multi-line messages in markdown mode, as they're either not portable across all clients, or they're mangled.

### Operating system

All Of Them

### Browser information

All Of Them

### URL for webapp

app.element.io

### Application version

1.11.86

### Homeserver

matrix.org

### 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.