A modern, accurate HTML parser and serializer for PHP
Find a file
J. King 9560358021 Character consumption cleanup
- 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
2019-12-18 18:03:47 -05:00
lib Character consumption cleanup 2019-12-18 18:03:47 -05:00
tests Tidying 2019-12-17 17:08:19 -05:00
vendor-bin Pass through surrogate characters 2019-12-18 15:15:02 -05:00
.gitignore Character reference fixes 2019-12-16 23:41:44 -05:00
AUTHORS Added authors file and updated license 2018-08-03 23:21:15 -05:00
composer.json Basic skeleton of test suite 2019-12-10 18:00:08 -05:00
composer.lock Pass through surrogate characters 2019-12-18 15:15:02 -05:00
LICENSE Added authors file and updated license 2018-08-03 23:21:15 -05:00
README.md Organization 2018-09-11 09:54:46 -05:00
robo Basic skeleton of test suite 2019-12-10 18:00:08 -05:00
robo.bat Basic skeleton of test suite 2019-12-10 18:00:08 -05:00
RoboFile.php New from-scratch character reference consumer 2019-12-16 22:39:16 -05:00

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