Skip to content

Commit

Permalink
Use name attr on meta tags too
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle Truscott committed Sep 15, 2015
1 parent 1101dd7 commit 5eb9bce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion metabolize.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func ParseDocument(doc io.Reader) (MetaData, error) {
var property, content string
for _, attr := range token.Attr {
switch attr.Key {
case "property":
case "property", "name":
property = strings.ToLower(attr.Val)
case "content":
content = attr.Val
Expand Down
2 changes: 2 additions & 0 deletions metabolize_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func Test_ParseDocument(t *testing.T) {
<html prefix="og: http://ogp.me/ns#">
<head>
<title>The Rock (1996)</title>
<meta name="description" content="MMMK" />
<meta property="" content="your mom" />
<meta property="title" content="The Rock" />
<meta property="og:title" content="The Rock" />
Expand All @@ -56,6 +57,7 @@ func Test_ParseDocument(t *testing.T) {
</html>
`
expectedData := MetaData{
"description": "MMMK",
"title": "The Rock",
"og:title": "The Rock",
"og:type": "video.movie",
Expand Down

0 comments on commit 5eb9bce

Please sign in to comment.