mirror of
https://github.com/golang/go
synced 2024-11-21 23:44:39 -07:00
exp/html: don't insert empty text nodes
Pass 1 additional test. R=nigeltao CC=golang-dev https://golang.org/cl/6443048
This commit is contained in:
parent
24ae7e686d
commit
899be50991
@ -267,6 +267,9 @@ func (p *parser) fosterParent(n *Node) {
|
||||
// addText adds text to the preceding node if it is a text node, or else it
|
||||
// calls addChild with a new text node.
|
||||
func (p *parser) addText(text string) {
|
||||
if text == "" {
|
||||
return
|
||||
}
|
||||
// TODO: distinguish whitespace text from others.
|
||||
t := p.top()
|
||||
if i := len(t.Child); i > 0 && t.Child[i-1].Type == TextNode {
|
||||
|
@ -4,7 +4,7 @@ PASS "<html> \x00 <frameset></frameset>"
|
||||
PASS "<html>a\x00a<frameset></frameset>"
|
||||
PASS "<html>\x00\x00<frameset></frameset>"
|
||||
PASS "<html>\x00\n <frameset></frameset>"
|
||||
FAIL "<html><select>\x00"
|
||||
PASS "<html><select>\x00"
|
||||
PASS "\x00"
|
||||
PASS "<body>\x00"
|
||||
FAIL "<plaintext>\x00filler\x00text\x00"
|
||||
|
Loading…
Reference in New Issue
Block a user