diff options
author | FiveFilters.org <[email protected]> | 2021-08-11 20:56:49 +0200 |
---|---|---|
committer | FiveFilters.org <[email protected]> | 2021-08-11 20:56:49 +0200 |
commit | 70287db73ace7e97dd4367f30208a792f4bafb63 (patch) | |
tree | 015a2360d0f7628629669e7bb23fd81d70125c64 /src/Readability.php | |
parent | eaed50db3ea45d4c2582cd2b413e70e11b8e3879 (diff) |
Prevent HTML5PHP from inserting doctype when serialising HTML
Diffstat (limited to 'src/Readability.php')
-rw-r--r-- | src/Readability.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Readability.php b/src/Readability.php index ab856f7..be60358 100644 --- a/src/Readability.php +++ b/src/Readability.php @@ -1750,7 +1750,9 @@ class Readability { if ($this->content instanceof DOMDocument) { $html5 = new HTML5(['disable_html_ns' => true]); - return $html5->saveHTML($this->content); + // by using childNodes below we make sure HTML5PHP's serialiser + // doesn't output the <!DOCTYPE html> string at the start. + return $html5->saveHTML($this->content->childNodes); } else { return null; } |