// 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 {
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"