Skip to content

Commit 1e8064f

Browse files
committed
Adding initial rel parsing support
1 parent 04bbc9b commit 1e8064f

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

.travis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
language: go
2+
notifications:
3+
email: false

microformats.go

+11
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,17 @@ func (p *Parser) walk(node *html.Node) {
6666
p.curItem = curItem
6767
}
6868

69+
if isAtom(node, atom.A) {
70+
if rel := GetAttr(node, "rel"); rel != "" {
71+
url := GetAttr(node, "href")
72+
//TODO: normalize url
73+
rels := strings.Split(rel, " ")
74+
for _, relval := range rels {
75+
p.curData.Rels[relval] = append(p.curData.Rels[relval], url)
76+
}
77+
}
78+
}
79+
6980
for c := node.FirstChild; c != nil; c = c.NextSibling {
7081
p.walk(c)
7182
}

0 commit comments

Comments
 (0)