You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
php-mf2 is a pure, generic [microformats-2](http://microformats.org/wiki/microformats-2) parser. It makes HTML as easy to consume as JSON.
6
6
@@ -16,7 +16,7 @@ To install using Composer, run
16
16
composer require mf2/mf2
17
17
```
18
18
19
-
If you can’t or don’t want to use Composer, then php-mf2 can be installed the old way by downloading [`/Mf2/Parser.php`](https://raw.githubusercontent.com/indieweb/php-mf2/master/Mf2/Parser.php), adding it to your project and requiring it from files you want to call its functions from, like this:
19
+
If you can’t or don’t want to use Composer, then php-mf2 can be installed the old way by downloading [`/Mf2/Parser.php`](https://raw.githubusercontent.com/microformats/php-mf2/master/Mf2/Parser.php), adding it to your project and requiring it from files you want to call its functions from, like this:
20
20
21
21
```php
22
22
<?php
@@ -297,7 +297,7 @@ Note that this option is still considered experimental and in development, and t
297
297
298
298
### Generating output for JSON serialization with JSON-mode
299
299
300
-
Due to a quirk with the way PHP arrays work, there is an edge case ([reported](https://github.com/indieweb/php-mf2/issues/29) by Tom Morris) in which a document with no rel values, when serialised as JSON, results in an empty object as the rels value rather than an empty array. Replacing this in code with a stdClass breaks PHP iteration over the values.
300
+
Due to a quirk with the way PHP arrays work, there is an edge case ([reported](https://github.com/microformats/php-mf2/issues/29) by Tom Morris) in which a document with no rel values, when serialised as JSON, results in an empty object as the rels value rather than an empty array. Replacing this in code with a stdClass breaks PHP iteration over the values.
301
301
302
302
As of version 0.2.6, the default behaviour is back to being PHP-friendly, so if you want to produce results specifically for serialisation as JSON (for example if you run a HTML -> JSON service, or want to run tests against JSON fixtures), enable JSON mode:
303
303
@@ -313,7 +313,7 @@ php-mf2 has some support for parsing classic microformats markup. It’s enabled
313
313
In previous versions of php-mf2 you could also add your own class mappings — officially this is no longer supported.
314
314
315
315
* If the built in mappings don’t successfully parse some classic microformats markup then raise an issue and we’ll fix it.
316
-
* If you want to screen-scrape websites which don’t use mf2 into mf2 data structures, consider contributing to [php-mf2-shim](https://github.com/indieweb/php-mf2-shim)
316
+
* If you want to screen-scrape websites which don’t use mf2 into mf2 data structures, consider contributing to [php-mf2-shim](https://github.com/microformats/php-mf2-shim)
317
317
* If you *really* need to make one-off changes to the default mappings… It is possible. But you have to figure it out for yourself ;)
318
318
319
319
## Security
@@ -374,13 +374,13 @@ Other Updates:
374
374
375
375
Bugfixes:
376
376
377
-
* Ensure empty `properties` is an object `{}` rather than array `[]` ([#171](https://github.com/indieweb/php-mf2/issues/171))
378
-
* Ensure the parser does not mutate the DOMDOcument passed in ([#174](https://github.com/indieweb/php-mf2/issues/174))
379
-
* Fix for multiple class names in backcompat parsing ([#156](https://github.com/indieweb/php-mf2/issues/156))
377
+
* Ensure empty `properties` is an object `{}` rather than array `[]` ([#171](https://github.com/microformats/php-mf2/issues/171))
378
+
* Ensure the parser does not mutate the DOMDOcument passed in ([#174](https://github.com/microformats/php-mf2/issues/174))
379
+
* Fix for multiple class names in backcompat parsing ([#156](https://github.com/microformats/php-mf2/issues/156))
380
380
381
381
Microformats Parsing Updates:
382
382
383
-
* New algorithm for plaintext values ([#168](https://github.com/indieweb/php-mf2/pull/168) and [parsing issue #15](https://github.com/microformats/microformats2-parsing/issues/15))
383
+
* New algorithm for plaintext values ([#168](https://github.com/microformats/php-mf2/pull/168) and [parsing issue #15](https://github.com/microformats/microformats2-parsing/issues/15))
384
384
* Always resolve URLs from `u-` properties even when not from a link element ([Parsing issue #10](https://github.com/microformats/microformats2-parsing/issues/10))
*[#157](https://github.com/indieweb/php-mf2/issues/157) - Parse `rel=tag` as `p-category` for hEntry and hReview
417
+
*[#157](https://github.com/microformats/php-mf2/issues/157) - Parse `rel=tag` as `p-category` for hEntry and hReview
418
418
419
419
#### v0.4.1
420
420
421
421
2018-03-15
422
422
423
423
Fixes:
424
424
425
-
*[#153](https://github.com/indieweb/php-mf2/issues/153) - Fixes parsed timestamps authored with a Z timezone offset
426
-
*[#151](https://github.com/indieweb/php-mf2/issues/151) - Adds back "value" of nested microformats when no matching property exists
425
+
*[#153](https://github.com/microformats/php-mf2/issues/153) - Fixes parsed timestamps authored with a Z timezone offset
426
+
*[#151](https://github.com/microformats/php-mf2/issues/151) - Adds back "value" of nested microformats when no matching property exists
427
427
428
428
429
429
#### v0.4.0
@@ -432,44 +432,44 @@ Fixes:
432
432
433
433
Breaking changes:
434
434
435
-
*[#125](https://github.com/indieweb/php-mf2/pull/125) - Add `rel-urls` to parsed result. Removes `alternates` by default but still available behind a feature flag.
436
-
*[#142](https://github.com/indieweb/php-mf2/pull/142) - Reduce instances of implied `p-name`. See Microformats issue [#6](https://github.com/microformats/microformats2-parsing/issues/6). This means it is now possible for the parsed result to *not* have a `name` property, whereas before there was always a `name` property on an object. Make sure consuming code can handle an object without a name now.
435
+
*[#125](https://github.com/microformats/php-mf2/pull/125) - Add `rel-urls` to parsed result. Removes `alternates` by default but still available behind a feature flag.
436
+
*[#142](https://github.com/microformats/php-mf2/pull/142) - Reduce instances of implied `p-name`. See Microformats issue [#6](https://github.com/microformats/microformats2-parsing/issues/6). This means it is now possible for the parsed result to *not* have a `name` property, whereas before there was always a `name` property on an object. Make sure consuming code can handle an object without a name now.
437
437
438
438
Fixes:
439
439
440
-
*[#124](https://github.com/indieweb/php-mf2/pull/124) - Fix for experimental lang parsing
441
-
*[#127](https://github.com/indieweb/php-mf2/issues/127) - Fix for parsing `h-*` class names containing invalid characters.
442
-
*[#131](https://github.com/indieweb/php-mf2/pull/131) - Improved `dt-` parsing. Issues [#126](https://github.com/indieweb/php-mf2/issues/126) and [#115](https://github.com/indieweb/php-mf2/issues/115).
443
-
*[#130](https://github.com/indieweb/php-mf2/issues/130) - Fix for implied properties with empty attributes.
444
-
*[#135](https://github.com/indieweb/php-mf2/issues/135) - Trim leading and tailing whitespace from HTML value as well as text value.
*[#116](https://github.com/indieweb/php-mf2/issues/116) - Fix backcompat parsing for `summary` property in `hreview`
448
-
*[#149](https://github.com/indieweb/php-mf2/issues/149) - Fix for datetime parsing, no longer tries to interpret the value and passes through instead
440
+
*[#124](https://github.com/microformats/php-mf2/pull/124) - Fix for experimental lang parsing
441
+
*[#127](https://github.com/microformats/php-mf2/issues/127) - Fix for parsing `h-*` class names containing invalid characters.
442
+
*[#131](https://github.com/microformats/php-mf2/pull/131) - Improved `dt-` parsing. Issues [#126](https://github.com/microformats/php-mf2/issues/126) and [#115](https://github.com/microformats/php-mf2/issues/115).
443
+
*[#130](https://github.com/microformats/php-mf2/issues/130) - Fix for implied properties with empty attributes.
444
+
*[#135](https://github.com/microformats/php-mf2/issues/135) - Trim leading and tailing whitespace from HTML value as well as text value.
*[#116](https://github.com/microformats/php-mf2/issues/116) - Fix backcompat parsing for `summary` property in `hreview`
448
+
*[#149](https://github.com/microformats/php-mf2/issues/149) - Fix for datetime parsing, no longer tries to interpret the value and passes through instead
449
449
450
450
#### v0.3.2
451
451
452
452
2017-05-27
453
453
454
454
* Fixed how the Microformats tests repo is loaded via composer
455
455
* Moved experimental language parsing feature behind an opt-in flag
456
-
*[#121](https://github.com/indieweb/php-mf2/pull/121) Fixed language detection to support parsing of HTML fragments
456
+
*[#121](https://github.com/microformats/php-mf2/pull/121) Fixed language detection to support parsing of HTML fragments
Many thanks to @aaronpk, @gRegorLove and @kylewm for contributions, @aaronpk and @kevinmarks for PR management and @tantek for issue reporting!
497
497
@@ -503,7 +503,7 @@ Many thanks to @aaronpk, @gRegorLove and @kylewm for contributions, @aaronpk and
503
503
504
504
2015-04-29
505
505
506
-
* Merged [#58](https://github.com/indieweb/php-mf2/pull/58), fixing some parsing bugs and adding support for area element parsing. Thanks so much for your hard work and patience, <aclass="h-card"href="http://ben.thatmustbe.me/">Ben</a>!
506
+
* Merged [#58](https://github.com/microformats/php-mf2/pull/58), fixing some parsing bugs and adding support for area element parsing. Thanks so much for your hard work and patience, <aclass="h-card"href="http://ben.thatmustbe.me/">Ben</a>!
507
507
508
508
#### v0.2.9
509
509
@@ -577,7 +577,7 @@ Many thanks to @aaronpk, @gRegorLove and @kylewm for contributions, @aaronpk and
577
577
#### v0.1.23
578
578
579
579
* Made some changes to the way back-compatibility with classic microformats are handled, ignoring classic property classnames inside mf2 roots and outside classic roots
580
-
* Deprecated ability to add new classmaps, removed twitter classmap. Use [php-mf2-shim](http://github.com/indieweb/php-mf2-shim) instead, it’s better
580
+
* Deprecated ability to add new classmaps, removed twitter classmap. Use [php-mf2-shim](http://github.com/microformats/php-mf2-shim) instead, it’s better
0 commit comments