Added subitems

pull/2/head
Ian Davis 2012-06-10 16:26:53 +01:00
parent cc14cf6b0c
commit da8a656b05
2 changed files with 3 additions and 2 deletions

View File

@ -4,6 +4,7 @@ import (
"bytes" "bytes"
"code.google.com/p/go-html-transform/h5" "code.google.com/p/go-html-transform/h5"
"io" "io"
"net/url"
"strings" "strings"
) )
@ -48,7 +49,7 @@ type Parser struct {
identifiedNodes map[string]*h5.Node identifiedNodes map[string]*h5.Node
} }
func NewParser(r io.Reader) *Parser { func NewParser(r io.Reader, url.URL) *Parser {
return &Parser{ return &Parser{
p: h5.NewParser(r), p: h5.NewParser(r),
data: NewMicrodata(), data: NewMicrodata(),

View File

@ -6,7 +6,7 @@ import (
) )
func ParseData(html string, t *testing.T) *Microdata { func ParseData(html string, t *testing.T) *Microdata {
p := NewParser(strings.NewReader(html)) p := NewParser(strings.NewReader(html), url.URL("http://example.com/")
data, err := p.Parse() data, err := p.Parse()
if err != nil { if err != nil {