From b09b3ad2f17be63b0e1f842d1cec5a9ab86ed636 Mon Sep 17 00:00:00 2001 From: Anders Pedersen Date: Mon, 13 Sep 2021 22:32:21 +0200 Subject: [PATCH] Fixed issue #1 --- src/Dom/Parser.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Dom/Parser.php b/src/Dom/Parser.php index 7915688..94232af 100644 --- a/src/Dom/Parser.php +++ b/src/Dom/Parser.php @@ -140,6 +140,10 @@ private function parseTag(Options $options, Content $content, int $size): TagDTO if (\trim($tag) == '') { // no tag found, invalid < found return TagDTO::makeFromPrimitives(); + } elseif ($tag === '!doctype') { + $tag = (new Tag($rawTag)) + ->noTrailingSlash() + ->selfClosing(); } } $node = new HtmlNode($tag, $rawTag);