element-hq / riot-android

A glossy Matrix collaboration client for Android
Apache License 2.0
1.4k stars 395 forks source link

Syntax class name in code HTML tag turns code block into inline code #2567

Open tulir opened 6 years ago

tulir commented 6 years ago

Events

1, 2 in #test:matrix.org

{
  "body": "```\ntest\n2\n3\n```",
  "msgtype": "m.text",
  "formatted_body": "<pre><code>test\n2\n3\n</code></pre>\n",
  "format": "org.matrix.custom.html"
}
{
  "body": "```test\ntest\n2\n3\n```",
  "msgtype": "m.text",
  "formatted_body": "<pre><code class=\"language-test\">test\n2\n3\n</code></pre>\n",
  "format": "org.matrix.custom.html"
}

The difference is class="language-test" in the code element. The language doesn't matter (valid languages break it too)

Riot Web

image

Riot Android 0.8.15-dev (G-b2359)

image

Related to #1718

triclops200 commented 5 years ago

I am also having this issue. It's frustrating, to say the least.