mirror of
https://github.com/golang/go.git
synced 2024-09-30 14:57:10 +00:00
html: parse <link> elements in <head>
Pass tests1.dat, test 83: <title><meta></title><link><title><meta></title> | <html> | <head> | <title> | "<meta>" | <link> | <title> | "<meta>" | <body> Also pass test 84: <style><!--</style><meta><script>--><link></script> R=nigeltao CC=golang-dev https://golang.org/cl/5331061
This commit is contained in:
parent
1c530d5d78
commit
77aabbf217
@ -455,8 +455,10 @@ func inHeadIM(p *parser) (insertionMode, bool) {
|
|||||||
implied = true
|
implied = true
|
||||||
case StartTagToken:
|
case StartTagToken:
|
||||||
switch p.tok.Data {
|
switch p.tok.Data {
|
||||||
case "meta":
|
case "base", "basefont", "bgsound", "command", "link", "meta":
|
||||||
// TODO.
|
p.addElement(p.tok.Data, p.tok.Attr)
|
||||||
|
p.oe.pop()
|
||||||
|
p.acknowledgeSelfClosingTag()
|
||||||
case "script", "title", "noscript", "noframes", "style":
|
case "script", "title", "noscript", "noframes", "style":
|
||||||
p.addElement(p.tok.Data, p.tok.Attr)
|
p.addElement(p.tok.Data, p.tok.Attr)
|
||||||
p.setOriginalIM(inHeadIM)
|
p.setOriginalIM(inHeadIM)
|
||||||
|
@ -133,7 +133,7 @@ func TestParser(t *testing.T) {
|
|||||||
rc := make(chan io.Reader)
|
rc := make(chan io.Reader)
|
||||||
go readDat(filename, rc)
|
go readDat(filename, rc)
|
||||||
// TODO(nigeltao): Process all test cases, not just a subset.
|
// TODO(nigeltao): Process all test cases, not just a subset.
|
||||||
for i := 0; i < 83; i++ {
|
for i := 0; i < 85; i++ {
|
||||||
// Parse the #data section.
|
// Parse the #data section.
|
||||||
b, err := ioutil.ReadAll(<-rc)
|
b, err := ioutil.ReadAll(<-rc)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user