Skip to content

Commit 7c7f502

Browse files
committed
update README with changelog for 0.3.1
1 parent a3eb26f commit 7c7f502

File tree

1 file changed

+54
-32
lines changed

1 file changed

+54
-32
lines changed

README.md

Lines changed: 54 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ php-mf2 is PSR-0 autoloadable, so simply include Composer’s auto-generated aut
6767

6868
## Examples
6969

70-
### Fetching microformats from a page
70+
### Fetching microformats from a URL
7171

7272
```php
7373
<?php
@@ -83,7 +83,7 @@ use Mf2;
8383
$mf = Mf2\fetch('http://microformats.org');
8484

8585
foreach ($mf['items'] as $microformat) {
86-
echo "A {$microformat['type'][0]} called {$microformat['properties']['name'][0]}\n";
86+
echo "A {$microformat['type'][0]} called {$microformat['properties']['name'][0]}\n";
8787
}
8888

8989
```
@@ -95,21 +95,24 @@ Here we demonstrate parsing of microformats2 implied property parsing, where an
9595
```php
9696
<?php
9797

98-
$output = Mf2\parse('<a class="h-card" href="https://waterpigs.co.uk/">Barnaby Walters</a>');
98+
$html = '<a class="h-card" href="https://waterpigs.co.uk/">Barnaby Walters</a>';
99+
$output = Mf2\parse($html, 'https://waterpigs.co.uk/');
99100
```
100101

101102
`$output` is a canonical microformats2 array structure like:
102103

103104
```json
104105
{
105-
"items": [{
106-
"type": ["h-card"],
107-
"properties": {
108-
"name": ["Barnaby Walters"],
109-
"url": ["https://waterpigs.co.uk/"]
110-
}
111-
}],
112-
"rels": {}
106+
"items": [
107+
{
108+
"type": ["h-card"],
109+
"properties": {
110+
"name": ["Barnaby Walters"],
111+
"url": ["https://waterpigs.co.uk/"]
112+
}
113+
}
114+
],
115+
"rels": {}
113116
}
114117
```
115118

@@ -123,8 +126,8 @@ Most of the time you’ll be getting your input HTML from a URL. You should pass
123126

124127
```html
125128
<div class="h-card">
126-
<h1 class="p-name">Mr. Example</h1>
127-
<img class="u-photo" alt="" src="/photo.png" />
129+
<h1 class="p-name">Mr. Example</h1>
130+
<img class="u-photo" alt="" src="/photo.png" />
128131
</div>
129132
```
130133

@@ -138,13 +141,13 @@ will result in the following output, with relative URLs made absolute:
138141

139142
```json
140143
{
141-
"items": [{
142-
"type": ["h-card"],
143-
"properties": {
144-
"photo": ["http://example.org/photo.png"]
145-
}
146-
}],
147-
"rels": {}
144+
"items": [{
145+
"type": ["h-card"],
146+
"properties": {
147+
"photo": ["http://example.org/photo.png"]
148+
}
149+
}],
150+
"rels": {}
148151
}
149152
```
150153

@@ -163,14 +166,14 @@ parsing will result in the following keys:
163166

164167
```json
165168
{
166-
"items": [],
167-
"rels": {
168-
"me": ["https://twitter.com/barnabywalters"]
169-
},
170-
"alternates": [{
171-
"url": "http://example.com/notes.atom",
172-
"rel": "etc"
173-
}]
169+
"items": [],
170+
"rels": {
171+
"me": ["https://twitter.com/barnabywalters"]
172+
},
173+
"alternates": [{
174+
"url": "http://example.com/notes.atom",
175+
"rel": "etc"
176+
}]
174177
}
175178
```
176179

@@ -195,7 +198,7 @@ To learn what the HTTP status code for any request was, or learn more about the
195198
196199
$mf = Mf2\fetch('http://waterpigs.co.uk/this-page-doesnt-exist', true, $curlInfo);
197200
if ($curlInfo['http_code'] == '404') {
198-
// This page doesn’t exist.
201+
// This page doesn’t exist.
199202
}
200203
201204
```
@@ -222,7 +225,7 @@ $parser->parseFromId('parse-from-here'); // returns a document with only the h-c
222225
223226
$elementIWant = $parser->query('an xpath query')[0];
224227
225-
$parser->parse(true, $elementIWant); // returns a document with only mfs under the selected element
228+
$parser->parse(true, $elementIWant); // returns a document with only the Microformats under the selected element
226229
227230
```
228231
@@ -286,6 +289,25 @@ Currently php-mf2 passes the majority of it’s own test case, and a good percen
286289

287290
### Changelog
288291

292+
#### v0.3.1
293+
294+
2017-05-24
295+
296+
* [#89](https://github.com/indieweb/php-mf2/issues/89) - Fixed parsing empty `img alt=""` attributes
297+
* [#91](https://github.com/indieweb/php-mf2/issues/91) - Ignore rel values from HTML tags that don't allow rel values
298+
* [#57](https://github.com/indieweb/php-mf2/issues/57) - Implement hAtom rel=bookmark backcompat
299+
* [#94](https://github.com/indieweb/php-mf2/pull/94) - Fixed HTML output when parsing e-* properties
300+
* [#97](https://github.com/indieweb/php-mf2/pull/97) - Experimental language parsing
301+
* [#88](https://github.com/indieweb/php-mf2/issues/88) - Fix for implied photo parsing
302+
* [#102](https://github.com/indieweb/php-mf2/pull/102) - Ignore classes with numbers or capital letters
303+
* [#111](https://github.com/indieweb/php-mf2/pull/111) - Improved backcompat parsing
304+
* [#106](https://github.com/indieweb/php-mf2/issues/106) - Send `Accept: text/html` header when using the `fetch` method
305+
* [#114](https://github.com/indieweb/php-mf2/issues/114) - Parse `poster` attribute for `video` tags
306+
* [#118](https://github.com/indieweb/php-mf2/issues/118) - Fixes parsing elements with missing attributes
307+
* Tests now use [microformats/tests](https://github.com/microformats/tests) repo
308+
309+
Many thanks to @gRegorLove for the major overhaul of the backcompat parsing!
310+
289311
#### v0.3.0
290312

291313
2016-03-14
@@ -378,8 +400,8 @@ Many thanks to @aaronpk, @gRegorLove and @kylewm for contributions, @aaronpk and
378400
* `Mf2\parse()` function added to simplify the most common case of just parsing some HTML
379401
* Updated e-* property parsing rules to match mf2 parsing spec — instead of producing inconsistent HTML content, it now produces dictionaries like <pre><code>
380402
{
381-
"html": "<b>The Content</b>",
382-
"value: "The Content"
403+
"html": "<b>The Content</b>",
404+
"value: "The Content"
383405
}
384406
</code></pre>
385407
* Removed `htmlSafe` options as new e-* parsing rules make them redundant

0 commit comments

Comments
 (0)