From: Dan Brown Date: Tue, 2 May 2023 11:44:55 +0000 (+0100) Subject: Set page include limit to be 3 as expected instead of 4 X-Git-Tag: v23.05~1^2~1 X-Git-Url: http://source.bookstackapp.com/bookstack/commitdiff_plain/ce0b75294fb22a69219a8c8d4aac1f69825422d5 Set page include limit to be 3 as expected instead of 4 --- diff --git a/app/Entities/Tools/PageContent.php b/app/Entities/Tools/PageContent.php index a12a19c66..949816eff 100644 --- a/app/Entities/Tools/PageContent.php +++ b/app/Entities/Tools/PageContent.php @@ -304,7 +304,7 @@ class PageContent if ($blankIncludes) { $content = $this->blankPageIncludes($content); } else { - for ($includeDepth = 0; $includeDepth <= 3; $includeDepth++) { + for ($includeDepth = 0; $includeDepth < 3; $includeDepth++) { $content = $this->parsePageIncludes($content); } } diff --git a/tests/Entity/PageContentTest.php b/tests/Entity/PageContentTest.php index cf67e27e2..d8845fe12 100644 --- a/tests/Entity/PageContentTest.php +++ b/tests/Entity/PageContentTest.php @@ -116,7 +116,8 @@ class PageContentTest extends TestCase $page->save(); $pageResp = $this->asEditor()->get($page->getUrl()); - $this->withHtml($pageResp)->assertElementContains('#bkmrk-test', 'Hello Barry Hello Barry Hello Barry ' . $tag); + $this->withHtml($pageResp)->assertElementContains('#bkmrk-test', 'Hello Barry Hello Barry Hello Barry Hello Barry ' . $tag); + $this->withHtml($pageResp)->assertElementNotContains('#bkmrk-test', 'Hello Barry Hello Barry Hello Barry Hello Barry Hello Barry ' . $tag); } public function test_page_content_scripts_removed_by_default()