mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-08-26 12:16:07 +00:00
parent
37de4e2e0a
commit
a7e3c26fe3
@ -223,10 +223,6 @@ class PageRepo
|
|||||||
{
|
{
|
||||||
$revision = new PageRevision($page->getAttributes());
|
$revision = new PageRevision($page->getAttributes());
|
||||||
|
|
||||||
if (setting('app-editor') !== 'markdown') {
|
|
||||||
$revision->markdown = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
$revision->page_id = $page->id;
|
$revision->page_id = $page->id;
|
||||||
$revision->slug = $page->slug;
|
$revision->slug = $page->slug;
|
||||||
$revision->book_slug = $page->book->slug;
|
$revision->book_slug = $page->book->slug;
|
||||||
@ -289,7 +285,13 @@ class PageRepo
|
|||||||
|
|
||||||
$page->fill($revision->toArray());
|
$page->fill($revision->toArray());
|
||||||
$content = new PageContent($page);
|
$content = new PageContent($page);
|
||||||
|
|
||||||
|
if (!empty($revision->markdown)) {
|
||||||
|
$content->setNewMarkdown($revision->markdown);
|
||||||
|
} else {
|
||||||
$content->setNewHTML($revision->html);
|
$content->setNewHTML($revision->html);
|
||||||
|
}
|
||||||
|
|
||||||
$page->updated_by = user()->id;
|
$page->updated_by = user()->id;
|
||||||
$page->refreshSlug();
|
$page->refreshSlug();
|
||||||
$page->save();
|
$page->save();
|
||||||
|
@ -90,7 +90,7 @@ class PageRevisionTest extends TestCase
|
|||||||
$pageView = $this->get($page->getUrl());
|
$pageView = $this->get($page->getUrl());
|
||||||
$this->assertDatabaseHas('pages', [
|
$this->assertDatabaseHas('pages', [
|
||||||
'id' => $page->id,
|
'id' => $page->id,
|
||||||
'markdown' => '## New Content Updated',
|
'markdown' => '## New Content def456',
|
||||||
]);
|
]);
|
||||||
$pageView->assertSee('abc123');
|
$pageView->assertSee('abc123');
|
||||||
$pageView->assertSee('def456');
|
$pageView->assertSee('def456');
|
||||||
|
Loading…
Reference in New Issue
Block a user