- $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);