I'm surprised that HTML5 support slipped through the cracks in PHP's DOM extension, but very glad Masterminds was there to cover for them. It's pretty easy to switch over and seems to be working well so far as a replacement HTML parser.

Only one quirk if you're not a composer fan, (the horror!) you need to write your own autoloader.  That's fair enough given you're opting out of a controlled file system structure, and luckily it's super easy. Instead of including Mastermind's HTML5.php directly you just need your own snippet, something like:
<?php

include 'HTML5.php';

function html5_autoload($className) {
  $file = 'library/' . str_replace('\', '/', $className) . '.php';
  if (file_exists($file)) include $file;
}

spl_autoload_register('html5_autoload');
indieweb
likesharereplyWant to share this? Click to choose a site:settings
Add a comment