fluentdom/html5

HTML5 support for FluentDOM

2.0.0 2021-05-08 14:37 UTC

This package is auto-updated.

Last update: 2024-10-08 22:00:18 UTC


README

License CI Total Downloads Latest Stable Version Latest Unstable Version

Adds support for HTML5 to FluentDOM. It adds a loader and a serializer. It uses the HTML5-PHP library.

Installation

composer require fluentdom/html5

Loader

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');

Serializer

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;