Adds support for HTML5 to FluentDOM. It adds a loader and a serializer. It uses the HTML5-PHP library.
composer require fluentdom/html5
The loader registers automatically. You can trigger it with the types html5
and text/html5
.
$document = FluentDOM::load($html5, 'text/html5');
$query = FluentDOM($html5, 'text/html5');
The serializer needs to be created with a document and can be cast into a string.
echo new FluentDOM\Html5\Serializer($document);
Casting a Nodes/Query instance to a string will use it if the content type matches:
$query = FluentDOM($html5, 'text/html5');
echo $query;