Skip to content

Commit b8c8ad9

Browse files
authored
Merge pull request #109 from jansauer/img-as-structure
Reflect the parsing rules for src and alt attributes on img elements
2 parents 92b5893 + 187d76f commit b8c8ad9

File tree

8 files changed

+205
-89
lines changed

8 files changed

+205
-89
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>h-card parsing tests</title>
6+
7+
<link rel="stylesheet" href="../../../css/testsuite.css">
8+
<link rel="stylesheet" href="../../../prettify.css">
9+
10+
<script src="../../../javascript/prettify.js"></script>
11+
<script src="../../../javascript/testsuite.js"></script>
12+
13+
</head>
14+
<body class="h-feed">
15+
16+
<h1 class="p-name"><span class="p-x-format">h-entry</span> parsing tests &dash; change logs</h1>
17+
18+
<p class="p-description">The files in this directory where designed to test the parsing of mark-up which mixes version 1 and 2 microformats. </p>
19+
<p class="p-description">Theses are backwards compatibility tests for the older version 1 microformats specification. Please do not use this as a reference for authoring microformats.</p>
20+
21+
<h2>Change log:</h2>
22+
<ul>
23+
<!-- Add change log event to the top of this list as a h-entry -->
24+
<li class="h-entry">
25+
<span class="p-name e-content">Updated JSON in order to reflect the parsing rules for src and alt attributes on img elements</span> &dash;
26+
<time class="dt-published" datetime="2019-06-24">24 June 2019</time>
27+
by <span class="p-author">Jan Sauer</span>
28+
</li>
29+
<li class="h-entry">
30+
<span class="p-name e-content">Created</span> &dash;
31+
<time class="dt-published" datetime="2012-09-10">7 June 2015</time>
32+
by <span class="p-author">Glenn Jones</span>
33+
</li>
34+
</ul>
35+
36+
<h2>Contributors:</h2>
37+
<ul>
38+
<!-- If you Contribute to the test please add yourself as an author using p-author h-card -->
39+
<li class="p-author h-card">
40+
<a class="u-url p-name" rel="author" href="http://www.glennjones.net/">Glenn Jones</a>
41+
</li>
42+
<li class="p-author h-card">
43+
<a class="u-url p-name" rel="author" href="https://jansauer.de/">Jan Sauer</a>
44+
</li>
45+
</ul>
46+
47+
<footer>
48+
All content and code is released into the <a href="http://en.wikipedia.org/wiki/public_domain">public domain</a>
49+
</footer>
50+
51+
</body>
52+
</html>

‎tests/microformats-mixed/h-entry/mixedroots.json

Lines changed: 39 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,44 @@
1-
21
{
3-
"items": [{
4-
"type": ["h-entry"],
5-
"properties": {
6-
"author": [{
7-
"value": "Aaron Parecki",
8-
"type": ["h-card"],
9-
"properties": {
10-
"photo": ["https://aaronparecki.com/images/aaronpk.png"],
11-
"logo": ["https://aaronparecki.com/images/aaronpk.png"],
12-
"url": ["https://aaronparecki.com/"],
13-
"uid": ["https://aaronparecki.com/"],
14-
"name": ["Aaron Parecki"]
15-
}
16-
}],
17-
"content": [{
18-
"value": "Did you play\n @playmapattackat\n #realtimeconf? Here is some more info about how we built it!\n http://pdx.esri.com/blog/2013/10/17/introducting-mapattack/",
19-
"html": "Did you play\n <a href=\"http://twitter.com/playmapattack\">@playmapattack</a>at\n <a href=\"http://aaronparecki.com/tag/realtimeconf\">#<span class=\"p-category\">realtimeconf</span></a>? Here is some more info about how we built it!\n <a href=\"http://pdx.esri.com/blog/2013/10/17/introducting-mapattack/\"><span class=\"protocol\">http://</span>pdx.esri.com/blog/2013/10/17/introducting-mapattack/</a>"
20-
}],
21-
"name": ["Did you play\n @playmapattackat\n #realtimeconf? Here is some more info about how we built it!\n http://pdx.esri.com/blog/2013/10/17/introducting-mapattack/"],
22-
"category": ["realtimeconf"]
2+
"items": [
3+
{
4+
"type": ["h-entry"],
5+
"properties": {
6+
"author": [
7+
{
8+
"value": "Aaron Parecki",
9+
"type": ["h-card"],
10+
"properties": {
11+
"photo": [
12+
{
13+
"alt": "Aaron Parecki",
14+
"value": "https://aaronparecki.com/images/aaronpk.png"
15+
}
16+
],
17+
"logo": [
18+
{
19+
"alt": "Aaron Parecki",
20+
"value": "https://aaronparecki.com/images/aaronpk.png"
21+
}
22+
],
23+
"url": ["https://aaronparecki.com/"],
24+
"uid": ["https://aaronparecki.com/"],
25+
"name": ["Aaron Parecki"]
26+
}
27+
}
28+
],
29+
"content": [
30+
{
31+
"value": "Did you play\n @playmapattackat\n #realtimeconf? Here is some more info about how we built it!\n http://pdx.esri.com/blog/2013/10/17/introducting-mapattack/",
32+
"html": "Did you play\n <a href=\"http://twitter.com/playmapattack\">@playmapattack</a>at\n <a href=\"http://aaronparecki.com/tag/realtimeconf\">#<span class=\"p-category\">realtimeconf</span></a>? Here is some more info about how we built it!\n <a href=\"http://pdx.esri.com/blog/2013/10/17/introducting-mapattack/\"><span class=\"protocol\">http://</span>pdx.esri.com/blog/2013/10/17/introducting-mapattack/</a>"
33+
}
34+
],
35+
"name": [
36+
"Did you play\n @playmapattackat\n #realtimeconf? Here is some more info about how we built it!\n http://pdx.esri.com/blog/2013/10/17/introducting-mapattack/"
37+
],
38+
"category": ["realtimeconf"]
39+
}
2340
}
24-
}],
41+
],
2542
"rels": {
2643
"author": ["https://aaronparecki.com/", "https://plus.google.com/117847912875913905493"]
2744
},

‎tests/microformats-v2/h-card/change-log.html

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,24 @@
1313
</head>
1414
<body class="h-feed">
1515

16-
<h1 class="p-name"><span class="p-x-format">h-card</span> parsing tests &dash; change logs</h1>
17-
18-
<p class="p-description">The files in this directory where designed to test the parsing of h-card. </p>
16+
<h1 class="p-name"><span class="p-x-format">h-card</span> parsing tests &dash; change logs</h1>
1917

18+
<p class="p-description">The files in this directory where designed to test the parsing of h-card.</p>
2019

2120
<h2>Change log:</h2>
2221
<ul>
2322
<!-- Add change log event to the top of this list as a h-entry -->
24-
<li class="h-entry">
23+
<li class="h-entry">
24+
<span class="p-name e-content">Updated JSON in order to reflect the parsing rules for src and alt attributes on img elements</span> &dash;
25+
<time class="dt-published" datetime="2019-06-24">24 June 2019</time>
26+
by <span class="p-author">Jan Sauer</span>
27+
</li>
28+
<li class="h-entry">
2529
<span class="p-name e-content">Added test for empty href="" attribute in implied property</span> &dash;
2630
<time class="dt-published" datetime="2017-06-3">3 June 2017</time>
2731
by <span class="p-author">Sven Knebel</span>
2832
</li>
29-
<li class="h-entry">
33+
<li class="h-entry">
3034
<span class="p-name e-content">Added test using empty href="" attribute to reference current page</span> &dash;
3135
<time class="dt-published" datetime="2017-05-27">27 May 2017</time>
3236
by <span class="p-author">Sven Knebel</span>
@@ -88,7 +92,6 @@ <h2>Change log:</h2>
8892
</li>
8993
</ul>
9094

91-
9295
<h2>Contributors:</h2>
9396
<ul>
9497
<!-- If you Contribute to the test please add yourself as an author using p-author h-card -->
@@ -98,16 +101,17 @@ <h2>Contributors:</h2>
98101
<li class="p-author h-card">
99102
<a class="u-url p-name" rel="author" href="http://www.glennjones.net/">Glenn Jones</a>
100103
</li>
101-
<li class="p-author h-card">
102-
<a class="u-url p-name" rel="author" href="https://www.svenknebel.de/">Sven Knebel</a>
103-
</li>
104+
<li class="p-author h-card">
105+
<a class="u-url p-name" rel="author" href="https://www.svenknebel.de/">Sven Knebel</a>
106+
</li>
107+
<li class="p-author h-card">
108+
<a class="u-url p-name" rel="author" href="https://jansauer.de/">Jan Sauer</a>
109+
</li>
104110
</ul>
105111

106-
107112
<footer>
108113
All content and code is released into the <a href="http://en.wikipedia.org/wiki/public_domain">public domain</a>
109114
</footer>
110115

111116
</body>
112-
113-
</html>
117+
</html>
Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
11
{
2-
"items": [{
3-
"type": ["h-card"],
4-
"properties": {
5-
"photo": ["http://blog.mozilla.org/press/files/2012/04/mitchell-baker.jpg"],
6-
"url": ["http://blog.lizardwrangler.com/", "https://twitter.com/MitchellBaker"],
7-
"name": ["Mitchell Baker"],
8-
"org": ["Mozilla Foundation"],
9-
"note": ["Mitchell is responsible for setting the direction and scope of the Mozilla Foundation and its activities."],
10-
"category": ["Strategy", "Leadership"]
11-
}
12-
}],
13-
"rels": {},
14-
"rel-urls": {}
15-
}
2+
"items": [
3+
{
4+
"type": ["h-card"],
5+
"properties": {
6+
"photo": [
7+
{
8+
"alt": "photo of Mitchell",
9+
"value": "http://blog.mozilla.org/press/files/2012/04/mitchell-baker.jpg"
10+
}
11+
],
12+
"url": ["http://blog.lizardwrangler.com/", "https://twitter.com/MitchellBaker"],
13+
"name": ["Mitchell Baker"],
14+
"org": ["Mozilla Foundation"],
15+
"note": [
16+
"Mitchell is responsible for setting the direction and scope of the Mozilla Foundation and its activities."
17+
],
18+
"category": ["Strategy", "Leadership"]
19+
}
20+
}
21+
],
22+
"rels": {},
23+
"rel-urls": {}
24+
}

‎tests/microformats-v2/h-entry/change-log.html

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,18 @@
1313
</head>
1414
<body class="h-feed">
1515

16-
<h1 class="p-name"><span class="p-x-format">h-entry</span> parsing tests &dash; change logs</h1>
17-
18-
<p class="p-description">The files in this directory where designed to test the expanding of relative URLs to absolute URLs in the HTML content of e-* propreties. </p>
16+
<h1 class="p-name"><span class="p-x-format">h-entry</span> parsing tests &dash; change logs</h1>
1917

18+
<p class="p-description">The files in this directory where designed to test the expanding of relative URLs to absolute URLs in the HTML content of e-* propreties.</p>
2019

2120
<h2>Change log:</h2>
2221
<ul>
2322
<!-- Add change log event to the top of this list as a h-entry -->
23+
<li class="h-entry">
24+
<span class="p-name e-content">Updated JSON in order to reflect the parsing rules for src and alt attributes on img elements</span> &dash;
25+
<time class="dt-published" datetime="2019-06-24">24 June 2019</time>
26+
by <span class="p-author">Jan Sauer</span>
27+
</li>
2428
<li class="h-entry">
2529
<span class="p-name e-content">Moved from experiemental implied value nested test</span> &dash;
2630
<time class="dt-published" datetime="2015-06-08">8 June 2015</time>
@@ -68,7 +72,6 @@ <h2>Change log:</h2>
6872
</li>
6973
</ul>
7074

71-
7275
<h2>Contributors:</h2>
7376
<ul>
7477
<!-- If you Contribute to the test please add yourself as an author using p-author h-card -->
@@ -78,13 +81,14 @@ <h2>Contributors:</h2>
7881
<li class="p-author h-card">
7982
<a class="u-url p-name" rel="author" href="http://www.glennjones.net/">Glenn Jones</a>
8083
</li>
84+
<li class="p-author h-card">
85+
<a class="u-url p-name" rel="author" href="https://jansauer.de/">Jan Sauer</a>
86+
</li>
8187
</ul>
8288

83-
8489
<footer>
8590
All content and code is released into the <a href="http://en.wikipedia.org/wiki/public_domain">public domain</a>
8691
</footer>
8792

8893
</body>
89-
90-
</html>
94+
</html>
Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,29 @@
11
{
2-
"items": [{
3-
"type": ["h-entry"],
4-
"properties": {
5-
"name": ["microformats.org at 7"],
6-
"url": ["http://microformats.org/", "http://microformats.org/2012/06/25/microformats-org-at-7", "http://microformats.org/2012/06/25/microformats-org-at-7", "http://microformats.org/", "http://microformats.org/wiki/microformats2-parsing", "http://microformats.org/wiki/value-class-pattern", "http://microformats.org/wiki/", "http://microformats.org/discuss"],
7-
"photo": ["http://example.com/images/logo.gif", "http://example.com/posterimage.jpg"]
8-
}
9-
}],
10-
"rels": {},
11-
"rel-urls": {}
12-
}
2+
"items": [
3+
{
4+
"type": ["h-entry"],
5+
"properties": {
6+
"name": ["microformats.org at 7"],
7+
"url": [
8+
"http://microformats.org/",
9+
"http://microformats.org/2012/06/25/microformats-org-at-7",
10+
"http://microformats.org/2012/06/25/microformats-org-at-7",
11+
"http://microformats.org/",
12+
"http://microformats.org/wiki/microformats2-parsing",
13+
"http://microformats.org/wiki/value-class-pattern",
14+
"http://microformats.org/wiki/",
15+
"http://microformats.org/discuss"
16+
],
17+
"photo": [
18+
{
19+
"alt": "company logos",
20+
"value": "images/logo.gif"
21+
},
22+
"http://example.com/posterimage.jpg"
23+
]
24+
}
25+
}
26+
],
27+
"rels": {},
28+
"rel-urls": {}
29+
}
Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,28 @@
11
{
2-
"items": [{
3-
"type": ["h-resume"],
4-
"properties": {
5-
"name": ["Tim Berners-Lee"],
6-
"summary": ["invented the World Wide Web"],
7-
"affiliation": [{
8-
"type": ["h-card"],
9-
"value": "W3C",
10-
"properties": {
11-
"name": ["W3C"],
12-
"photo": ["http://www.w3.org/Icons/WWW/w3c_home_nb.png"]
2+
"items": [
3+
{
4+
"type": ["h-resume"],
5+
"properties": {
6+
"name": ["Tim Berners-Lee"],
7+
"summary": ["invented the World Wide Web"],
8+
"affiliation": [
9+
{
10+
"type": ["h-card"],
11+
"value": "W3C",
12+
"properties": {
13+
"name": ["W3C"],
14+
"photo": [
15+
{
16+
"alt": "W3C",
17+
"value": "http://www.w3.org/Icons/WWW/w3c_home_nb.png"
1318
}
14-
}]
15-
}
16-
}],
17-
"rels": {},
18-
"rel-urls": {}
19+
]
20+
}
21+
}
22+
]
23+
}
24+
}
25+
],
26+
"rels": {},
27+
"rel-urls": {}
1928
}

0 commit comments

Comments
 (0)