Closed maltee1 closed 1 year ago
Doesn't seem reproducible with just a newline
So apparently this happens when I send it from Nheko, not Element, with a single linebreak, which is rendered as a space. Element doesn't include the html tags. Sorry about the confusion. For clarification, this is what breaks:
"content": {
"body": "https://dies.ist.ein/test\nDies ist ein test",
"format": "org.matrix.custom.html",
"formatted_body": "<a href=\"https://dies.ist.ein/test\">https://dies.ist.ein/test</a>\nDies ist ein test",
"msgtype": "m.text"
}
There's no line break in that HTML, so sounds like a Nheko bug (or feature if they're intentionally using markdown like that)
I just updated nheko, it's fixed now.
When sending a link, some matrix clients (such as element) will convert that to a html reference. I suppose WhatsApp doesn't render html tags, so they need to be removed before sending. The WhatsApp client then recognizes the link itself and makes it clickable for the user.
The problem is, if a link is followed by a newline, that newline will be removed along with the html tags, appending the first word on the new line to the link, which causes WhatsApp to include that word into the clickable link, making it invalid. This caused quite some confusion in one of my groups. Mautrix-signal, which is bridging part of the same group, does not have that issue.