Skip to content

Releases: microformats/php-mf2

v0.5.0

10 Feb 01:34
v0.5.0
Compare
Choose a tag to compare

Breaking changes:

  • Bumped minimum PHP version from 5.4 to 5.6 (#220)
  • #214 parse an img element for src and alt — i.e. all property values parsed as image URLs where the img element has an alt attribute will now be a {'value': 'url', 'alt': 'the alt value'} structure rather than a single URL string
  • Renamed master branch to main. Anyone who had been installing the latest development version with dev-master will need to change their requirements to dev-main

Other changes:

  • #195 Fix backcompat parsing for geo property
  • #182 Fix parsing for iframe.u-*[src]
  • #206 Add optional ID for h-* elements
  • #198 reduce instances where photo is implied
  • Internal: switched from Travis to Github Actions for CI

0.4.6

24 Aug 14:51
0.4.6
00b70ee
Compare
Choose a tag to compare

Bugfixes:

  • Don't include img src attribute in implied p-name (#180)
  • Normalize ordinal dates in VCP values (#167)
  • Fix for accidental array access of stdClass in deeply nested structures (#196)
  • Reduce instances where u-url is implied according to a spec update (#183 and parsing issue #36)
  • Fix for wrongly implied photo property (#190)

Other Updates:

  • Adds a filter to avoid running tests that require a live internet connection (#194)
  • Refactor implied name code to match new implied name handling of photo and url (#193)
  • Moved this repo to the microformats GitHub organization (#179)

Bugfix

02 Aug 17:14
v0.4.5
35fee8b
Compare
Choose a tag to compare

Bugfixe:

  • Fix for parsing empty e- elements

Other Updates:

  • Added .editorconfig to the project and cleaned up whitespace across all files

Whitespace Updates and Bugfixes

01 Aug 20:04
v0.4.4
463351e
Compare
Choose a tag to compare

Bugfixes:

  • Ensure empty properties is an object {} rather than array [] (#171)
  • Ensure the parser does not mutate the DOMDOcument passed in (#174)
  • Fix for multiple class names in backcompat parsing (#156)

Microformats Parsing Updates:

Other Updates:

  • Improved test coverage

Optional HTML5 Support

29 Mar 18:44
v0.4.3
5c056e8
Compare
Choose a tag to compare

This release includes support for using an alternative HTML parser that understands HTML5 tags.

The built-in HTML parser does not understand some HTML5 tags such as <article>, which causes issues when those tags are adjacent to elements that can be automatically closed, such as <p>. A simple example that is incorrectly parsed with a non-HTML5 parser is below.

<div class="h-entry">
  <p class="p-name">Hello World
  <article class="e-content">The content of the blog post</article>
</div>

Without proper knowledge of HTML5 tags such as <article>, the contents of that tag ends up inside the p-name in this example. Using an HTML5 parser will properly close the <p> tag and return the expected result.

The php-mf2 library does not automatically install the HTML5 parser, since it does not want to impose additional dependencies on your code base. If you wish to use the HTML5 parser, you can include it in your project explicitly, either by loading it manually or using composer:

composer require masterminds/html5

If this library is present, then the php-mf2 parser will use it when parsing HTML.

Bugfixes

29 Mar 16:57
v0.4.2
62d395b
Compare
Choose a tag to compare

Fixes:

  • #165 - Prevents inadvertently adding whitespace to the html value
  • #158 - Allows numbers in vendor prefixed names
  • #160 - Ignores class names with consecutive dashes
  • #159 - Remove duplicate values from type and rels arrays
  • #162 - Improved rel attribute parsing

Backcompat:

  • #157 - Parse rel=tag as p-category for hEntry and hReview

Bugfixes

15 Mar 16:56
v0.4.1
e044330
Compare
Choose a tag to compare
  • #153 - Fixes parsed timestamps authored with a Z timezone offset
  • #151 - Adds back "value" of nested microformats when no matching property exists

Improved implied name parsing, bugfixes, and improved backcompat parsing

13 Mar 23:37
42ef6eb
Compare
Choose a tag to compare

Breaking changes

  • #125 - Add rel-urls to parsed result. Removes alternates by default but still available behind a feature flag.
  • #142 - Reduce instances of implied p-name. See Microformats issue #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.

Fixes

  • #124 - Fix for experimental lang parsing
  • #127 - Fix for parsing h-* class names containing invalid characters.
  • #131 - Improved dt- parsing. Issues #126 and #115.
  • #130 - Fix for implied properties with empty attributes.
  • #135 - Trim leading and tailing whitespace from HTML value as well as text value.
  • #137 - Fix backcompat hfeed parsing.
  • #134 - Fix rel=bookmark backcompat parsing.
  • #116 - Fix backcompat parsing for summary property in hreview
  • #149 - Fix for datetime parsing, no longer tries to interpret the value and passes through instead

Thanks to @gRegorLove and @jkphl for all their hard work in this release!

Bugfixes, improved backcompat parsing, and experimental language parsing

27 May 15:33
v0.3.2
Compare
Choose a tag to compare

This release includes the following fixes:

  • #89 - Fixed parsing empty img alt="" attributes
  • #91 - Ignore rel values from HTML tags that don't allow rel values
  • #57 - Implement hAtom rel=bookmark backcompat
  • #94 - Fixed HTML output when parsing e-* properties
  • #88 - Fix for implied photo parsing
  • #102 - Ignore classes with numbers or capital letters
  • #111 - Improved backcompat parsing
  • #106 - Send Accept: text/html header when using the fetch method
  • #114 - Parse poster attribute for video tags
  • #118 - Fixes parsing elements with missing attributes
  • #97 - Experimental language parsing
  • #121 - Fixed language detection to support HTML fragments
  • #123 - Moved language parsing behind feature flag
  • Tests now use microformats/tests repo

Bugfixes and improved backcompat parsing

25 May 14:52
v0.3.1
7c7f502
Compare
Choose a tag to compare

This release contained an error in the composer.json file causing installations via composer to fail. Release notes have been moved to v0.3.2