mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-09-29 20:55:45 +00:00
Review of #4192, Fixed formatting and added test
This commit is contained in:
parent
011800d425
commit
56f234d1ee
@ -303,10 +303,10 @@ class PageContent
|
|||||||
|
|
||||||
if ($blankIncludes) {
|
if ($blankIncludes) {
|
||||||
$content = $this->blankPageIncludes($content);
|
$content = $this->blankPageIncludes($content);
|
||||||
} else {
|
} else {
|
||||||
for ($includeDepth = 0; $includeDepth <= 3; $includeDepth++) {
|
for ($includeDepth = 0; $includeDepth <= 3; $includeDepth++) {
|
||||||
$content = $this->parsePageIncludes($content);
|
$content = $this->parsePageIncludes($content);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $content;
|
return $content;
|
||||||
|
@ -108,6 +108,17 @@ class PageContentTest extends TestCase
|
|||||||
$htmlContent->assertSee('my cat is awesome and scratchy');
|
$htmlContent->assertSee('my cat is awesome and scratchy');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function test_page_includes_can_be_nested_up_to_three_times()
|
||||||
|
{
|
||||||
|
$page = $this->entities->page();
|
||||||
|
$tag = "{{@{$page->id}#bkmrk-test}}";
|
||||||
|
$page->html = '<p id="bkmrk-test">Hello Barry ' . $tag . '</p>';
|
||||||
|
$page->save();
|
||||||
|
|
||||||
|
$pageResp = $this->asEditor()->get($page->getUrl());
|
||||||
|
$this->withHtml($pageResp)->assertElementContains('#bkmrk-test', 'Hello Barry Hello Barry Hello Barry ' . $tag);
|
||||||
|
}
|
||||||
|
|
||||||
public function test_page_content_scripts_removed_by_default()
|
public function test_page_content_scripts_removed_by_default()
|
||||||
{
|
{
|
||||||
$this->asEditor();
|
$this->asEditor();
|
||||||
|
Loading…
Reference in New Issue
Block a user