Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple code blocks in a single message are alternately syntax-highlighted #28607

Closed
Taywee opened this issue Dec 1, 2024 · 0 comments · Fixed by #28613
Closed

Multiple code blocks in a single message are alternately syntax-highlighted #28607

Taywee opened this issue Dec 1, 2024 · 0 comments · Fixed by #28613
Assignees
Labels
O-Occasional Affects or can be seen by some users regularly or most users rarely S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect

Comments

@Taywee
Copy link

Taywee commented Dec 1, 2024

Steps to reproduce

When I send this message:

```json
{ "foo": "bar" }
```

```json
{ "foo": "bar" }
```

```json
{ "foo": "bar" }
```

```json
{ "foo": "bar" }
```

```json
{ "foo": "bar" }
```

```json
{ "foo": "bar" }
```

```json
{ "foo": "bar" }
```

```json
{ "foo": "bar" }
```

The result shows only every other one syntax highlighted.

Outcome

2024-12-01T14-10-53

The event source shows that the html is correct, so I think this is a rendering bug, possibly all client-side:

{
  "type": "m.room.message",
  "content": {
    "msgtype": "m.text",
    "body": "```json\n{ \"foo\": \"bar\" }\n```\n\n```json\n{ \"foo\": \"bar\" }\n```\n\n```json\n{ \"foo\": \"bar\" }\n```\n\n```json\n{ \"foo\": \"bar\" }\n```\n\n```json\n{ \"foo\": \"bar\" }\n```\n\n```json\n{ \"foo\": \"bar\" }\n```\n\n```json\n{ \"foo\": \"bar\" }\n```\n\n```json\n{ \"foo\": \"bar\" }\n```\n\n",
    "format": "org.matrix.custom.html",
    "formatted_body": "<pre><code class=\"language-json\">{ \"foo\": \"bar\" }\n</code></pre>\n<pre><code class=\"language-json\">{ \"foo\": \"bar\" }\n</code></pre>\n<pre><code class=\"language-json\">{ \"foo\": \"bar\" }\n</code></pre>\n<pre><code class=\"language-json\">{ \"foo\": \"bar\" }\n</code></pre>\n<pre><code class=\"language-json\">{ \"foo\": \"bar\" }\n</code></pre>\n<pre><code class=\"language-json\">{ \"foo\": \"bar\" }\n</code></pre>\n<pre><code class=\"language-json\">{ \"foo\": \"bar\" }\n</code></pre>\n<pre><code class=\"language-json\">{ \"foo\": \"bar\" }\n</code></pre>\n",
    "m.mentions": {}
  }
}

The expanded formatted_body:

<pre><code class="language-json">{ "foo": "bar" }
</code></pre>
<pre><code class="language-json">{ "foo": "bar" }
</code></pre>
<pre><code class="language-json">{ "foo": "bar" }
</code></pre>
<pre><code class="language-json">{ "foo": "bar" }
</code></pre>
<pre><code class="language-json">{ "foo": "bar" }
</code></pre>
<pre><code class="language-json">{ "foo": "bar" }
</code></pre>
<pre><code class="language-json">{ "foo": "bar" }
</code></pre>
<pre><code class="language-json">{ "foo": "bar" }
</code></pre>

Operating system

Fedora release 41 (Forty One)

Browser information

Firefox 133.0-1.fc41

URL for webapp

app.element.io

Application version

Element version: 1.11.86

Homeserver

matrix.org

Will you send logs?

Yes

@Taywee Taywee added the T-Defect label Dec 1, 2024
@dosubot dosubot bot added O-Occasional Affects or can be seen by some users regularly or most users rarely S-Minor Impairs non-critical functionality or suitable workarounds exist labels Dec 1, 2024
@t3chguy t3chguy self-assigned this Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-Occasional Affects or can be seen by some users regularly or most users rarely S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants