microformats 4.0.2 → 4.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/microformats/parser.rb +10 -8
- data/lib/microformats/version.rb +1 -1
- data/spec/support/lib/edge_cases/blank_rel.html +23 -0
- data/spec/support/lib/edge_cases/blank_rel.js +41 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96d92a5bb4aaef19f5e6fa918cd5ffc556c76ec0
|
4
|
+
data.tar.gz: 8ab579244cd67680bbca05ee4d14700680676462
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fa1e48cb0c84380e0d123ea89faa16192dd6ed2580348b14d170d82cac3b69100fbfaaf66a8d306989f39be8698d69af1167d3f9e6fd9cff24ea617f3dcca5f
|
7
|
+
data.tar.gz: 31a5ec4d62d21bcf985100eb27ec3dfc9d604c963a3a5e7260125f405cf14483451c713fc736cfec108aab62fa6297f791fa0d5c2fee5715616dbc71a0df1943
|
data/README.md
CHANGED
data/lib/microformats/parser.rb
CHANGED
@@ -90,14 +90,16 @@ module Microformats
|
|
90
90
|
@rels[rel_value].uniq!
|
91
91
|
end
|
92
92
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
93
|
+
unless rel_values.empty?
|
94
|
+
@rel_urls[url] = {} unless @rel_urls.has_key?(url)
|
95
|
+
|
96
|
+
@rel_urls[url]['hreflang'] = rel.attribute('hreflang').value if @rel_urls[url]['hreflang'].nil? and not rel.attribute('hreflang').nil?
|
97
|
+
@rel_urls[url]['media'] = rel.attribute('media').value if @rel_urls[url]['media'].nil? and not rel.attribute('media').nil?
|
98
|
+
@rel_urls[url]['title'] = rel.attribute('title').value if @rel_urls[url]['title'].nil? and not rel.attribute('title').nil?
|
99
|
+
@rel_urls[url]['type'] = rel.attribute('type').value if @rel_urls[url]['type'].nil? and not rel.attribute('type').nil?
|
100
|
+
@rel_urls[url]['text'] = rel.text.strip if @rel_urls[url]['text'].nil? and not rel.text.empty?
|
101
|
+
@rel_urls[url]['rels'] = rel_values
|
102
|
+
end
|
101
103
|
|
102
104
|
end
|
103
105
|
end
|
data/lib/microformats/version.rb
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<base href="http://example.org/">
|
4
|
+
<body>
|
5
|
+
<div class="h-card">
|
6
|
+
<a href="/" class="u-url p-name">
|
7
|
+
Jessica Lynn Suttles
|
8
|
+
</a>
|
9
|
+
<a href="http://flickr.com" class="u-url" rel="">
|
10
|
+
@jlsuttles
|
11
|
+
</a>
|
12
|
+
<a href="http://twitter.com/jlsuttles" class="u-url" rel="me">
|
13
|
+
@jlsuttles
|
14
|
+
</a>
|
15
|
+
<time class="dt-bday" datetime="1990-10-15">
|
16
|
+
October 15, 1990
|
17
|
+
</time>
|
18
|
+
<div class="e-content">
|
19
|
+
<p>Vegan. Cat lover. Coder.</p>
|
20
|
+
</div>
|
21
|
+
</div>
|
22
|
+
</body>
|
23
|
+
</html>
|
@@ -0,0 +1,41 @@
|
|
1
|
+
{
|
2
|
+
"items": [
|
3
|
+
{
|
4
|
+
"type": [
|
5
|
+
"h-card"
|
6
|
+
],
|
7
|
+
"properties": {
|
8
|
+
"url": [
|
9
|
+
"http://example.org/",
|
10
|
+
"http://flickr.com",
|
11
|
+
"http://twitter.com/jlsuttles"
|
12
|
+
],
|
13
|
+
"name": [
|
14
|
+
"Jessica Lynn Suttles"
|
15
|
+
],
|
16
|
+
"bday": [
|
17
|
+
"1990-10-15"
|
18
|
+
],
|
19
|
+
"content": [
|
20
|
+
{
|
21
|
+
"value": "Vegan. Cat lover. Coder.",
|
22
|
+
"html": "\n <p>Vegan. Cat lover. Coder.</p>\n"
|
23
|
+
}
|
24
|
+
]
|
25
|
+
}
|
26
|
+
}
|
27
|
+
],
|
28
|
+
"rels": {
|
29
|
+
"me": [
|
30
|
+
"http://twitter.com/jlsuttles"
|
31
|
+
]
|
32
|
+
},
|
33
|
+
"rel-urls": {
|
34
|
+
"http://twitter.com/jlsuttles": {
|
35
|
+
"text": "@jlsuttles",
|
36
|
+
"rels": [
|
37
|
+
"me"
|
38
|
+
]
|
39
|
+
}
|
40
|
+
}
|
41
|
+
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: microformats
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shane Becker
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-05-
|
13
|
+
date: 2017-05-22 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: nokogiri
|
@@ -183,6 +183,8 @@ files:
|
|
183
183
|
- spec/support/cases/microformats.org/microformats-2/microformats-2-9.js
|
184
184
|
- spec/support/lib/edge_cases/blank_href.html
|
185
185
|
- spec/support/lib/edge_cases/blank_href.js
|
186
|
+
- spec/support/lib/edge_cases/blank_rel.html
|
187
|
+
- spec/support/lib/edge_cases/blank_rel.js
|
186
188
|
- spec/support/lib/edge_cases/blank_src.html
|
187
189
|
- spec/support/lib/edge_cases/blank_src.js
|
188
190
|
- spec/support/lib/edge_cases/relative.html
|
@@ -541,6 +543,8 @@ test_files:
|
|
541
543
|
- spec/support/cases/microformats.org/microformats-2/microformats-2-9.js
|
542
544
|
- spec/support/lib/edge_cases/blank_href.html
|
543
545
|
- spec/support/lib/edge_cases/blank_href.js
|
546
|
+
- spec/support/lib/edge_cases/blank_rel.html
|
547
|
+
- spec/support/lib/edge_cases/blank_rel.js
|
544
548
|
- spec/support/lib/edge_cases/blank_src.html
|
545
549
|
- spec/support/lib/edge_cases/blank_src.js
|
546
550
|
- spec/support/lib/edge_cases/relative.html
|