X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/fe0e307313916ec7776069190a21f53f58b58837..refs/pull/2296/head:/tests/Entity/PageContentTest.php diff --git a/tests/Entity/PageContentTest.php b/tests/Entity/PageContentTest.php index 69b46b06e..99547fd17 100644 --- a/tests/Entity/PageContentTest.php +++ b/tests/Entity/PageContentTest.php @@ -262,6 +262,23 @@ class PageContentTest extends TestCase $this->assertEquals(substr_count($updatedPage->html, "bkmrk-test\""), 1); } + public function test_anchors_referencing_non_bkmrk_ids_rewritten_after_save() + { + $this->asEditor(); + $page = Page::first(); + + $content = '

test

link

'; + $this->put($page->getUrl(), [ + 'name' => $page->name, + 'html' => $content, + 'summary' => '' + ]); + + $updatedPage = Page::where('id', '=', $page->id)->first(); + $this->assertStringContainsString('id="bkmrk-test"', $updatedPage->html); + $this->assertStringContainsString('href="#bkmrk-test"', $updatedPage->html); + } + public function test_get_page_nav_sets_correct_properties() { $content = '

Hello

There

Donkey

';