Convert newlines to <br> in whatsapp->matrix formatted messages

This commit is contained in:
Tulir Asokan 2019-07-18 00:07:44 +03:00
parent 921c1209ea
commit 7f0a0df7de

View file

@ -126,6 +126,7 @@ func (formatter *Formatter) ParseWhatsApp(content *mautrix.Content) {
output = regex.ReplaceAllStringFunc(output, replacer)
}
if output != content.Body {
output = strings.Replace(output, "\n", "<br/>", -1)
content.FormattedBody = output
content.Format = mautrix.FormatHTML
for regex, replacer := range formatter.waReplFuncText {