Browse Source

Make backcompat location match other libs

master
J. King 1 year ago
parent
commit
1000727649
  1. 2
      lib/Parser.php
  2. 25
      tests/cases/json/phpmf2/vevent/summary.html
  3. 31
      tests/cases/json/phpmf2/vevent/summary.json

2
lib/Parser.php

@ -78,7 +78,7 @@ class Parser {
'label' => ['h-card' => ["p", "label"]],
'latitude' => ['h-card' => ["p", "latitude"], 'h-event' => ["p", "latitude"], 'h-geo' => ["p", "latitude"]],
'locality' => ['h-adr' => ["p", "locality"], 'h-card' => ["p", "locality"]],
'location' => ['h-event' => ["p", "location", ["adr", "vcard"]]],
'location' => ['h-event' => ["p", "location"]],
'logo' => ['h-card' => ["u", "logo"]],
'longitude' => ['h-card' => ["p", "longitude"], 'h-event' => ["p", "longitude"], 'h-geo' => ["p", "longitude"]],
'mailer' => ['h-card' => ["p", "mailer"]],

25
tests/cases/json/phpmf2/vevent/summary.html

@ -0,0 +1,25 @@
<!--
The JSON output of this test is consistent with the Python and Go
libraries, but not php-mf2 itself, as it contains a spurious vcard and
omits the location entirely.
-->
<div class="vevent">
<h3 class="summary">XYZ Project Review</h3>
<p class="description">Project XYZ Review Meeting</p>
<p> <a class="url" href="http://example.com/xyz-meeting">http://example.com/xyz-meeting</a> </p>
<p>To be held on
<span class="dtstart">
<abbr class="value" title="1998-03-12">the 12th of March</abbr>
from <span class="value">8:30am</span> <abbr class="value" title="-0500">EST</abbr>
</span> until
<span class="dtend">
<span class="value">9:30am</span> <abbr class="value" title="-0500">EST</abbr>
</span>
</p>
<p>Location: <span class="location">1CP Conference Room 4350</span></p>
<small>Booked by: <span class="uid">guid-1.host1.com</span> on
<span class="dtstamp">
<abbr class="value" title="1998-03-09">the 9th</abbr> at <span class="value">6:00pm</span>
</span>
</small>
</div>

31
tests/cases/json/phpmf2/vevent/summary.json

@ -0,0 +1,31 @@
{
"items": [
{
"type": [
"h-event"
],
"properties": {
"name": [
"XYZ Project Review"
],
"description": [
"Project XYZ Review Meeting"
],
"url": [
"http://example.com/xyz-meeting"
],
"location": [
"1CP Conference Room 4350"
],
"start": [
"1998-03-12 08:30-0500"
],
"end": [
"1998-03-12 09:30-0500"
]
}
}
],
"rels": {},
"rel-urls": {}
}
Loading…
Cancel
Save