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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user