Added subitems

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

View File

@ -6,7 +6,7 @@ import (
)
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()
if err != nil {