Php Mf2 Versions Save

php-mf2 is a pure, generic microformats-2 parser for PHP. It makes HTML as easy to consume as JSON.

v0.5.0

2 years ago

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

5 years ago

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)

v0.4.5

5 years ago

Bugfixe:

  • Fix for parsing empty e- elements

Other Updates:

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

v0.4.4

5 years ago

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

v0.4.3

6 years ago

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.

v0.4.2

6 years ago

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

v0.4.1

6 years ago
  • #153 - Fixes parsed timestamps authored with a Z timezone offset
  • #151 - Adds back "value" of nested microformats when no matching property exists

v0.4.0

6 years ago

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!

v0.3.2

6 years ago

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

v0.3.1

6 years ago

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