Skip to content
Snippets Groups Projects
Commit dfbf101d authored by Evgeniy Melnikov's avatar Evgeniy Melnikov Committed by Vladimir Roudakov
Browse files

Issue #3266193 by Chalk, Liam Morland: Warning: DOMNode::appendChild(): Document Fragment is empty

parent ebd63a54
Branches
Tags
No related merge requests found
......@@ -113,7 +113,9 @@ class TocBuilder implements TocBuilderInterface {
];
$fragment_node = $dom->createDocumentFragment();
$fragment_node->appendXML($this->renderer->render($build));
$dom->getElementsByTagName('body')->item(0)->appendChild($fragment_node);
if (!empty($fragment_node->textContent)) {
$dom->getElementsByTagName('body')->item(0)->appendChild($fragment_node);
}
}
return Html::serialize($dom);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment