Improve handling of multiple linebreaks
This commit is contained in:
@ -289,7 +289,7 @@ func (parser *htmlParser) tagNodeToEntity(node *html.Node, stripLinebreak bool)
|
||||
case "h1", "h2", "h3", "h4", "h5", "h6":
|
||||
return parser.headerToEntity(node, stripLinebreak)
|
||||
case "br":
|
||||
return &messages.BaseHTMLEntity{Tag: "br", Block: true}
|
||||
return messages.NewBreakEntity()
|
||||
case "b", "strong", "i", "em", "s", "del", "u", "ins", "font":
|
||||
return parser.basicFormatToEntity(node, stripLinebreak)
|
||||
case "a":
|
||||
|
@ -113,7 +113,7 @@ func ParseMessage(matrix ifc.MatrixContainer, room *rooms.Room, evt *mautrix.Eve
|
||||
replyToEvt.Content.FormattedBody = html.EscapeString(replyToEvt.Content.Body)
|
||||
}
|
||||
evt.Content.FormattedBody = fmt.Sprintf(
|
||||
"In reply to <a href='https://matrix.to/#/%[1]s'>%[1]s</a><blockquote>%[2]s</blockquote><br/>%[3]s",
|
||||
"In reply to <a href='https://matrix.to/#/%[1]s'>%[1]s</a><blockquote>%[2]s</blockquote><br/><br/>%[3]s",
|
||||
replyToEvt.Sender, replyToEvt.Content.FormattedBody, evt.Content.FormattedBody)
|
||||
} else {
|
||||
evt.Content.FormattedBody = fmt.Sprintf(
|
||||
|
Reference in New Issue
Block a user