Ignore newlines in HTML completely again

This commit is contained in:
Tulir Asokan 2022-04-15 20:29:23 +03:00
parent 5674f076be
commit e46694a33f

View File

@ -382,6 +382,7 @@ func (parser *htmlParser) singleNodeToEntity(node *html.Node) Entity {
switch node.Type {
case html.TextNode:
if !parser.preserveWhitespace {
node.Data = strings.ReplaceAll(node.Data, "\n", "")
node.Data = spaces.ReplaceAllLiteralString(node.Data, " ")
}
if len(node.Data) == 0 {