1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-08-06 12:02:45 +03:00

Includes: Developed to get new system working with inline includes

Adds logic for locating and splitting text nodes.
Adds specific classes to offload tag/content specific logic.
This commit is contained in:
Dan Brown
2023-11-23 14:29:07 +00:00
parent 04d21c8a97
commit 75936454cc
5 changed files with 192 additions and 8 deletions

View File

@@ -149,4 +149,19 @@ class HtmlDocument
{
return $this->document->saveHTML($node);
}
/**
* Adopt the given nodes into this document.
* @param DOMNode[] $nodes
* @return DOMNode[]
*/
public function adoptNodes(array $nodes): array
{
$adopted = [];
foreach ($nodes as $node) {
$adopted[] = $this->document->importNode($node, true);
}
return $adopted;
}
}