onetsp / RecipeParser

A PHP library for parsing structured recipe data from HTML files.
https://onetsp.com/
MIT License
93 stars 26 forks source link

DomDocument / libxml2 failing to parse HTML5 #21

Open emilhdiaz opened 9 years ago

emilhdiaz commented 9 years ago

Hi Mike!

We've been noticing quite a few problems when trying to parse pages that contain HTML5 tags. Seems that libxml2, which PHP's DomDocument uses under the hood, only has support for up to HTML4. For example parsing fails on http://bsugarmama.com/3-layer-french-vanilla-pudding-cake-chocolate-fudge-frosting/

See the following bug reports: https://www.drupal.org/node/1333730 https://bugs.php.net/bug.php?id=60021

We've been successfully experimenting with Mastermind's HTML5-PHP parser: https://github.com/Masterminds/html5-php http://engineeredweb.com/blog/2013/introducing-html5-parser-serializer-php/

Just wondering if you've run into this issue before and if you think it'd be worth to switch the parser for OneTSP?