]> BookStack Code Mirror - bookstack/commitdiff
Set page include limit to be 3 as expected instead of 4
authorDan Brown <redacted>
Tue, 2 May 2023 11:44:55 +0000 (12:44 +0100)
committerDan Brown <redacted>
Tue, 2 May 2023 11:44:55 +0000 (12:44 +0100)
app/Entities/Tools/PageContent.php
tests/Entity/PageContentTest.php

index a12a19c661e431fee733dd449ffd27f167763820..949816eff577cc2fc67e0a36c8507bc4d2efe8d1 100644 (file)
@@ -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);
             }
         }
index cf67e27e24a77be3b2067a4e1d98eb89ac1b6d9d..d8845fe127662d8008b1c88262761f6476810d71 100644 (file)
@@ -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()