diff --git a/.gitignore b/.gitignore index 94e56df..47b08cc 100644 --- a/.gitignore +++ b/.gitignore @@ -13,5 +13,3 @@ website/ couscous-theme/ .couscous/ couscous.yml - - diff --git a/src/Blocks/Block.php b/src/Blocks/Block.php index cbf30f9..7c5b322 100644 --- a/src/Blocks/Block.php +++ b/src/Blocks/Block.php @@ -67,7 +67,7 @@ public function close() } $args = $this->args; $this->opened--; - $this->args = []; + $this->opened === 0 and $this->args = []; array_unshift($args, ob_get_clean()); $block = call_user_func_array($this->callback, $args); diff --git a/src/Section/Section.php b/src/Section/Section.php index 48df938..7f97083 100644 --- a/src/Section/Section.php +++ b/src/Section/Section.php @@ -79,8 +79,7 @@ public function replace() $this->mode = self::MODE_REPLACE; } $buffer = ob_get_clean(); - $this->content or $this->content = $buffer; - $this->content = ($this->mode & self::MODE_APPEND) ? $buffer.$this->content : $this->content; + $this->content = ($this->mode & self::MODE_APPEND) ? $buffer.$this->content : $buffer; if ($this->mode & self::MODE_OUTPUT) { echo $this->content(); }