@@ -133,7 +133,7 @@ def object_to_json(obj, trim_nulls=True, entry_class='h-entry',
133
133
# TODO: more tags. most will be p-category?
134
134
ret = {
135
135
'type' : (['h-card' ] if obj_type == 'person'
136
- else ['h-card' , 'h-geo ' ] if obj_type == 'place'
136
+ else ['h-card' , 'p-location ' ] if obj_type == 'place'
137
137
else [entry_class ]),
138
138
'properties' : {
139
139
'uid' : [obj .get ('id' , '' )],
@@ -243,8 +243,7 @@ def json_to_object(mf2):
243
243
}
244
244
245
245
mf2_types = mf2 .get ('type' ) or []
246
- mf2_type = ('location' if 'h-geo' in mf2_types
247
- else 'person' if 'h-card' in mf2_types
246
+ mf2_type = ('location' if 'h-geo' in mf2_types or 'p-location' in mf2_types
248
247
else mf2util .post_type_discovery (mf2 ))
249
248
as_type , as_verb = mf2_type_to_as_type .get (mf2_type , (None , None ))
250
249
@@ -505,7 +504,7 @@ def hcard_to_html(hcard, parent_props=[]):
505
504
photo = prop .get ('photo' )
506
505
return HCARD .substitute (
507
506
prop ,
508
- types = ' ' .join (parent_props + hcard ['type' ]),
507
+ types = ' ' .join (util . uniquify ( parent_props + hcard ['type' ]) ),
509
508
photo = img (photo , 'u-photo' , '' ) if photo else '' ,
510
509
linked_name = maybe_linked_name (hcard ['properties' ]))
511
510
0 commit comments