A modern, accurate HTML parser and serializer for PHP
J. King
9560358021
- Newline normalization now done on-the-fly - Consequently, original input string is used as-is - Byte order mark is not supposed to be skipped - Use more straightforward method of tracking column position - Simplify backtracking when spanning - Genericize character interpretation: this will be expanded to emit illegal-character parse errors when appropriate |
||
---|---|---|
lib | ||
tests | ||
vendor-bin | ||
.gitignore | ||
AUTHORS | ||
composer.json | ||
composer.lock | ||
LICENSE | ||
README.md | ||
robo | ||
robo.bat | ||
RoboFile.php |
HTML5
Tools for parsing and printing HTML5 documents and fragments.
<?php
$dom = dW\HTML5\Parser::parse('<!DOCTYPE html><html lang="en" charset="utf-8"><head><title>Ook!</title></head><body><h1>Ook!</h1><p>Ook-ook? Oooook. Ook ook oook ook oooooook ook ooook ook.</p><p>Eek!</p></body></html>');
?>
or:
<?php
$dom = new dW\HTML5\Document;
$dom->loadHTML('<!DOCTYPE html><html lang="en" charset="utf-8"><head><title>Ook!</title></head><body><h1>Ook!</h1><p>Ook-ook? Oooook. Ook ook oook ook oooooook ook ooook ook.</p><p>Eek!</p></body></html>');
?>