From e1a61e45c900e96e8ea0cc6cb2d32ac7ddbf548f Mon Sep 17 00:00:00 2001 From: Cojad Date: Fri, 7 Oct 2016 15:18:31 +0800 Subject: [PATCH] update with full list html5 self closing tags html5 spec has a list of void elements (aka self closing tags) https://www.w3.org/TR/html5/syntax.html#void-elements --- src/PHPHtmlParser/Dom.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/PHPHtmlParser/Dom.php b/src/PHPHtmlParser/Dom.php index f3e17ff9..323000f9 100644 --- a/src/PHPHtmlParser/Dom.php +++ b/src/PHPHtmlParser/Dom.php @@ -79,15 +79,23 @@ class Dom * @var array */ protected $selfClosing = [ - 'img', + 'area', + 'base', + 'basefont', 'br', + 'col', + 'embed', + 'hr', + 'img', 'input', - 'meta', + 'keygen', 'link', - 'hr', - 'base', - 'embed', + 'meta', + 'param', + 'source', 'spacer', + 'track', + 'wbr' ]; /**