From 905ea234bc6ce9295c1733adf01dbee77b6fdbee Mon Sep 17 00:00:00 2001 From: "J. King" Date: Wed, 6 Oct 2021 14:05:43 -0400 Subject: [PATCH] Align parser better with test suite 1. Null-character tree construction errors have been added 2. Comments outside the root element are now tested for correctly --- README.md | 9 +++--- lib/Parser/ParseError.php | 4 +++ lib/Parser/TreeBuilder.php | 8 ++--- tests/cases/TestTreeConstructor.php | 49 +++++++++-------------------- 4 files changed, 25 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index b9c1c38..a81e655 100644 --- a/README.md +++ b/README.md @@ -19,11 +19,10 @@ The API is still in flux, but should be finalized soon. 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 `