mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-06 12:02:45 +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:
@@ -2,7 +2,9 @@
|
||||
|
||||
namespace Tests\Unit;
|
||||
|
||||
use BookStack\Entities\Tools\PageIncludeContent;
|
||||
use BookStack\Entities\Tools\PageIncludeParser;
|
||||
use BookStack\Entities\Tools\PageIncludeTag;
|
||||
use BookStack\Util\HtmlDocument;
|
||||
use Tests\TestCase;
|
||||
|
||||
@@ -227,8 +229,9 @@ class PageIncludeParserTest extends TestCase
|
||||
protected function runParserTest(string $html, array $contentById, string $expected): void
|
||||
{
|
||||
$doc = new HtmlDocument($html);
|
||||
$parser = new PageIncludeParser($doc, function (int $id) use ($contentById) {
|
||||
return $contentById[strval($id)] ?? '';
|
||||
$parser = new PageIncludeParser($doc, function (PageIncludeTag $tag) use ($contentById): PageIncludeContent {
|
||||
$html = $contentById[strval($tag->getPageId())] ?? '';
|
||||
return PageIncludeContent::fromHtmlAndTag($html, $tag);
|
||||
});
|
||||
|
||||
$parser->parse();
|
||||
|
Reference in New Issue
Block a user