Skip to content

Commit 8df2455

Browse files
committed
Fix microformats#127: Change backcompat rules to mf1 roots in properties
Changes the implied roots to mf1 root to properly cause nested backcompat parsing. In cases where property == mf1 root name, no class for it is added.
1 parent f0a97dc commit 8df2455

8 files changed

+22
-24
lines changed

mf2py/backcompat-rules/hentry.json

+5-6
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,12 @@
1919
"p-summary"
2020
],
2121
"author": [
22-
"p-author",
23-
"h-card"
24-
],
22+
"p-author",
23+
"vcard"
24+
],
2525
"geo": [
26-
"p-geo",
27-
"h-geo"
28-
],
26+
"p-geo"
27+
],
2928
"updated": [
3029
"dt-updated"
3130
]

mf2py/backcompat-rules/hproduct.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
],
2727
"review": [
2828
"p-review",
29-
"h-review"
29+
"hreview"
3030
],
3131
"fn": [
3232
"p-name"

mf2py/backcompat-rules/hresume.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,26 @@
44
],
55
"properties": {
66
"experience": [
7-
"h-event",
8-
"p-experience"
7+
"p-experience",
8+
"vevent"
99
],
1010
"summary": [
1111
"p-summary"
1212
],
1313
"affiliation": [
1414
"p-affiliation",
15-
"h-card"
15+
"vcard"
1616
],
1717
"contact": [
18-
"h-card",
19-
"p-contact"
18+
"p-contact",
19+
"vcard"
2020
],
2121
"skill": [
2222
"p-skill"
2323
],
2424
"education": [
25-
"h-event",
26-
"p-education"
25+
"p-education",
26+
"vevent"
2727
]
2828
}
2929
}

mf2py/backcompat-rules/hreview-aggregate.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"reviewer": [
1919
"p-reviewer",
2020
"p-author",
21-
"h-card"
21+
"vcard"
2222
],
2323
"best": [
2424
"p-best"

mf2py/backcompat-rules/hreview.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
],
1515
"reviewer": [
1616
"p-author",
17-
"h-card"
17+
"vcard"
1818
],
1919
"url": [
2020
"p-item",
21-
"h-item",
21+
"h-item",
2222
"u-url"
2323
],
2424
"photo": [

mf2py/backcompat-rules/vcard.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131
"p-category"
3232
],
3333
"adr": [
34-
"p-adr",
35-
"h-adr"
34+
"p-adr"
3635
],
3736
"locality": [
3837
"p-locality"
@@ -80,8 +79,7 @@
8079
"p-honorific-prefix"
8180
],
8281
"geo": [
83-
"p-geo",
84-
"h-geo"
82+
"p-geo"
8583
],
8684
"fn": [
8785
"p-name"

mf2py/backcompat-rules/vevent.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"dt-start"
2020
],
2121
"geo": [
22-
"p-location h-geo"
22+
"p-location"
2323
],
2424
"organizer": [
2525
"p-organizer"

test/test_parser.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -606,9 +606,10 @@ def test_value_name_whitespace():
606606
def test_backcompat_hentry():
607607
result = parse_fixture("backcompat/hentry.html")
608608
assert_true('h-entry' in result['items'][0]['type'])
609+
assert_equal({},
610+
result['items'][0]['properties']['author'][0]['properties'])
609611
assert_equal('Tom Morris',
610-
result['items'][0]['properties']
611-
['author'][0]['properties']['name'][0])
612+
result['items'][0]['properties']['author'][0]['value'])
612613
assert_equal('A Title',
613614
result['items'][0]['properties']['name'][0])
614615
assert_equal('Some Content',

0 commit comments

Comments
 (0)