element-hq / element-hq/element-android

formatted message not displayed correctly

Open
#2,328 4 comments 4 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
3.7k
Forks
917
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**

An "org.matrix.custom.html" formatted message is not displayed correctly,
i.e. it is not displayed in a box as code, but it is incorrectly displayed
just like plain text. This is an example of a message that is displayed
incorrectly as plain text.
```
{
"type": "m.room.message",
"content": {
"msgtype": "m.text",
"body": "test, NOT working, not in a box, not formatted as code",
"format": "org.matrix.custom.html",
"formatted_body": "

test, NOT working, not in a box, not formatted as code
\n"
}
}
```

This is platform, i.e. Android, specific. On other platforms, e.g. browser,
element-desktop, it works correctly.

The next message will be displayed in a box as code, because of the
3 ticks at beginning and end of text in "body".

```
{
"type": "m.room.message",
"content": {
"msgtype": "m.text",
"body": "```\ntest, working\n```",
"format": "org.matrix.custom.html",
"formatted_body": "

test, working
\n"
}
}
```

**To Reproduce**
Steps to reproduce the behavior:
1. Install all of the latest software
2. Install latest version of Android app for Element , e.g. 1.0.9
3. Use an Matrix API and generate/send a message like this:
3.b. To avoid using API, use `matrix-commander.py --code -m "test" --room yourroomhere`

```
{
"type": "m.room.message",
"content": {
"msgtype": "m.text",
"body": "test",
"format": "org.matrix.custom.html",
"formatted_body": "

test\n
\n"
}
}
```

4. Observe how it is displayed on Android? versus Firefox and element-desktop.

**Expected behavior**
The above message should be displayed formatted as code in a box.
Element does so on all platforms EXCEPT Android.

**Screenshots**
none

**Smartphone (please complete the following information):**
- Old Samsung from 2016
- OS: Android 5.1.1

**Additional context**
- App version : Element (Android) 1.0.9

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.