|
|
@ -301,9 +301,19 @@ class Parser { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private function buildParagraph(array $elms) : void { |
|
|
|
private function buildParagraph(array $elms) : void { |
|
|
|
|
|
|
|
if (count($elms) < 1) |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
$elm = $this->document->createElement("p"); |
|
|
|
$elm = $this->document->createElement("p"); |
|
|
|
foreach ($elms as $node) |
|
|
|
$i = 0; |
|
|
|
|
|
|
|
foreach ($elms as $node) { |
|
|
|
|
|
|
|
if (trim($node->textContent) === "") |
|
|
|
|
|
|
|
continue; |
|
|
|
$elm->appendChild($node); |
|
|
|
$elm->appendChild($node); |
|
|
|
|
|
|
|
$i++; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if ($i < 1) |
|
|
|
|
|
|
|
return; |
|
|
|
$this->document->appendChild($elm); |
|
|
|
$this->document->appendChild($elm); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|