summaryrefslogtreecommitdiff
path: root/src/HTMLParser.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/HTMLParser.php')
-rw-r--r--src/HTMLParser.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/HTMLParser.php b/src/HTMLParser.php
index f35a950..5d86065 100644
--- a/src/HTMLParser.php
+++ b/src/HTMLParser.php
@@ -673,7 +673,8 @@ class HTMLParser
// Remove DIV, SECTION, and HEADER nodes without any content(e.g. text, image, video, or iframe).
if (($node->tagNameEqualsTo('div') || $node->tagNameEqualsTo('section') || $node->tagNameEqualsTo('header') ||
$node->tagNameEqualsTo('h1') || $node->tagNameEqualsTo('h2') || $node->tagNameEqualsTo('h3') ||
- $node->tagNameEqualsTo('h4') || $node->tagNameEqualsTo('h5') || $node->tagNameEqualsTo('h6')) &&
+ $node->tagNameEqualsTo('h4') || $node->tagNameEqualsTo('h5') || $node->tagNameEqualsTo('h6') ||
+ $node->tagNameEqualsTo('p')) &&
$node->isElementWithoutContent()) {
$node = $node->removeAndGetNext($node);
continue;