diff --git a/templates/error/get_display.twig b/templates/error/get_display.twig
index 56645d5a41..43e22a08e7 100644
--- a/templates/error/get_display.twig
+++ b/templates/error/get_display.twig
@@ -1,8 +1,8 @@
- {% if isUserError == false %}
+ {%- if isUserError == false %}
{{ type }} in {{ file ~'#'~ line }}
- {% endif %}
+ {% endif -%}
{{ message }}
diff --git a/test/classes/ErrorTest.php b/test/classes/ErrorTest.php
index 27061e0988..0f830ac5ee 100644
--- a/test/classes/ErrorTest.php
+++ b/test/classes/ErrorTest.php
@@ -131,7 +131,7 @@ class ErrorTest extends AbstractTestCase
public function testGetDisplay(): void
{
$this->assertStringContainsString(
- '
Warning',
+ '
Warning',
$this->object->getDisplay()
);
}