-
Notifications
You must be signed in to change notification settings - Fork 43
Description
As recently learned in the chat, Matrix messages cannot be interpreted directly as markdown. Such formatting is purely coincidental, just as users directly using BBCode would be.
See this message content for example.
"content": {
"msgtype": "m.text",
"body": "*test*",
"format": "org.matrix.custom.html",
"formatted_body": "<em>test</em>"
}
The body contains markdown formatting, but this cannot be used directly. Instead we have to check the format, which will likely be non-existent for plaintext or org.matrix.custom.html
like here. In that case we can interpret the formatted_body
as HTML and render that.
It's totally up to clients to specify how users can markup their messages. For outgoing messages it would likely make sense for Nio to just assume markdown (and show a live formatting preview in the message composer), turn that into HTML and format the message content as above.