# HTML-Parser A modern, accurate HTML parser for PHP. ## Usage ```php Ook!

Ook!

Ook-ook? Oooook. Ook ook oook ook oooooook ook ooook ook.

Eek!

'); $document = $out->document; // the parsed document $encoding = $out->encoding; // the canonical name of the detected or supplied encoding $quirks = $out->quirksMode; // the quirks-mode setting of the document, needed for parsing fragments into the document later ``` The API is still in flux, but should be finalized soon. ## Limitations The primary aim of this library is accuracy. If the document object differs from what the specification mandates, this is probably a bug. However, we are also constrained by PHP, which imposes various limtations. These are as follows: - Due to PHP's DOM being designed for XML, element and attribute names which are illegal in XML are mangled as recommended by the specification - PHP's DOM does not allow comments to be inserted outside the root element. The parser will perform the insertions, but the comment nodes are then silently dropped - PHP's DOM has no special understanding of the HTML `