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

Pages API: Made raw_html available on page responses

To provide a way to see the original un-pre-processed database HTML
content.

For #4310
This commit is contained in:
Dan Brown
2023-06-20 17:07:46 +01:00
parent 41c3ed154b
commit 8b935e71d1
6 changed files with 22 additions and 6 deletions

View File

@ -139,6 +139,7 @@ class Page extends BookChild
{
$refreshed = $this->refresh()->unsetRelations()->load(['tags', 'createdBy', 'updatedBy', 'ownedBy']);
$refreshed->setHidden(array_diff($refreshed->getHidden(), ['html', 'markdown']));
$refreshed->setAttribute('raw_html', $refreshed->html);
$refreshed->html = (new PageContent($refreshed))->render();
return $refreshed;