Ignore newlines in HTML completely again
This commit is contained in:
parent
5674f076be
commit
e46694a33f
@ -382,6 +382,7 @@ func (parser *htmlParser) singleNodeToEntity(node *html.Node) Entity {
|
|||||||
switch node.Type {
|
switch node.Type {
|
||||||
case html.TextNode:
|
case html.TextNode:
|
||||||
if !parser.preserveWhitespace {
|
if !parser.preserveWhitespace {
|
||||||
|
node.Data = strings.ReplaceAll(node.Data, "\n", "")
|
||||||
node.Data = spaces.ReplaceAllLiteralString(node.Data, " ")
|
node.Data = spaces.ReplaceAllLiteralString(node.Data, " ")
|
||||||
}
|
}
|
||||||
if len(node.Data) == 0 {
|
if len(node.Data) == 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user