1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Includes: Switched page to new system

- Added mulit-level depth parsing.
- Updating usage of HTML doc in page content to be efficient.
- Removed now redundant PageContentTest cases.
- Made some include system fixes based upon testing.
This commit is contained in:
Dan Brown
2023-11-27 19:54:47 +00:00
parent 4874dc1304
commit 71c93c8878
7 changed files with 60 additions and 148 deletions

View File

@ -8,7 +8,7 @@ use Tests\TestCase;
class PageContentTest extends TestCase
{
protected $base64Jpeg = '/9j/2wBDAAMCAgICAgMCAgIDAwMDBAYEBAQEBAgGBgUGCQgKCgkICQkKDA8MCgsOCwkJDRENDg8QEBEQCgwSExIQEw8QEBD/yQALCAABAAEBAREA/8wABgAQEAX/2gAIAQEAAD8A0s8g/9k=';
protected string $base64Jpeg = '/9j/2wBDAAMCAgICAgMCAgIDAwMDBAYEBAQEBAgGBgUGCQgKCgkICQkKDA8MCgsOCwkJDRENDg8QEBEQCgwSExIQEw8QEBD/yQALCAABAAEBAREA/8wABgAQEAX/2gAIAQEAAD8A0s8g/9k=';
public function test_page_includes()
{
@ -57,38 +57,6 @@ class PageContentTest extends TestCase
$this->assertEquals('', $page->text);
}
public function test_page_includes_do_not_break_tables()
{
$page = $this->entities->page();
$secondPage = $this->entities->page();
$content = '<table id="table"><tbody><tr><td>test</td></tr></tbody></table>';
$secondPage->html = $content;
$secondPage->save();
$page->html = "{{@{$secondPage->id}#table}}";
$page->save();
$pageResp = $this->asEditor()->get($page->getUrl());
$pageResp->assertSee($content, false);
}
public function test_page_includes_do_not_break_code()
{
$page = $this->entities->page();
$secondPage = $this->entities->page();
$content = '<pre id="bkmrk-code"><code>var cat = null;</code></pre>';
$secondPage->html = $content;
$secondPage->save();
$page->html = "{{@{$secondPage->id}#bkmrk-code}}";
$page->save();
$pageResp = $this->asEditor()->get($page->getUrl());
$pageResp->assertSee($content, false);
}
public function test_page_includes_rendered_on_book_export()
{
$page = $this->entities->page();