1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-08-07 23:03:00 +03:00

Includes: Added back support for parse theme event

Managed to do this in an API-compatible way although resuling output may
differ due to new dom handling in general, although user content is used
inline to remain as comptable as possible.
This commit is contained in:
Dan Brown
2023-11-27 21:38:43 +00:00
parent b569827114
commit 652d5417bf
7 changed files with 106 additions and 35 deletions

View File

@@ -19,6 +19,9 @@ class PageIncludeParser
*/
protected array $toCleanup = [];
/**
* @param Closure(PageIncludeTag $tag): PageContent $pageContentForId
*/
public function __construct(
protected HtmlDocument $doc,
protected Closure $pageContentForId,
@@ -35,8 +38,8 @@ class PageIncludeParser
$tags = $this->locateAndIsolateIncludeTags();
foreach ($tags as $tag) {
$htmlContent = $this->pageContentForId->call($this, $tag->getPageId());
$content = new PageIncludeContent($htmlContent, $tag);
/** @var PageIncludeContent $content */
$content = $this->pageContentForId->call($this, $tag);
if (!$content->isInline()) {
$parentP = $this->getParentParagraph($tag->domNode);