matrix-appservice-discord icon indicating copy to clipboard operation
matrix-appservice-discord copied to clipboard

\n in formatted_body aren't ignored

Open Miepee opened this issue 3 years ago • 1 comments

Describe the bug \n in in a matrix' formatted_body should always be ignored by clients (and the bridge), as it's not responsible for showing line breaks (<br/> is). However, the bridge currently does not ignore it, and when sending to discord replaces the \n with a newline, even though it shouldn't

To Reproduce Steps to reproduce the behavior:

  1. Send a Matrix message whose formatted_body contains multiple \n', like the following string:
message\n<br />\nnewline

Expected behavior

message
newline

should be the message sent to discord

Actual behavior

messsage


newline

is the message that's actually sent.

Additional context Originally discovered with the NeoChat client, as it currently does not strip \n's from formatted_body

Miepee avatar Jul 24 '22 10:07 Miepee

Thanks for the report. Sounds like a simple parser bug to me that we should fix!

Half-Shot avatar Jul 29 '22 15:07 Half-Shot