Skip to content

First Newline becomes <br>, even in code block #97

@HarHarLinks

Description

@HarHarLinks

sending data like

"text": "<pre><code>{\n    \"another\": [\n        \"contains\",\n        \"a\",\n        \"list\"\n    ],\n    \"payload\": \"testing\"\n}\n</code></pre>\n",
"format": "html",

(yes that's pretty printed json as the body)
results in (element view source)

"content": {
    "body": "{    \"another\": [\n        \"contains\",\n        \"a\",\n        \"list\"\n    ],\n    \"payload\": \"testing\"\n}\n\n",
    "msgtype": "m.text",
    "format": "org.matrix.custom.html",
    "formatted_body": "<pre><code>{<br>    \"another\": [\n        \"contains\",\n        \"a\",\n        \"list\"\n    ],\n    \"payload\": \"testing\"\n}\n</code></pre>\n"
  },

noticably the first \n in the original message is dropped/converted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions