From 66cd67736d68157c60bb566e84e97cc37f1b7beb Mon Sep 17 00:00:00 2001 From: LaoDC Date: Sun, 12 Apr 2026 14:51:18 +0700 Subject: [PATCH] Fix Twig markdown on example text (#3414) Fix Twig markdown on example text. When attempting to render the example markdown in email settings, an error is raised. `An exception has been thrown during the rendering of a template ("{closure}(): Argument #1 ($content) must be of type ?string, Twig\Markup given` Twig\Markup contains __toString() so casting to string resolves the issue. --- src/library/Box/TwigExtensions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/library/Box/TwigExtensions.php b/src/library/Box/TwigExtensions.php index 76ed71f9e..96dd64af1 100644 --- a/src/library/Box/TwigExtensions.php +++ b/src/library/Box/TwigExtensions.php @@ -383,7 +383,7 @@ class Box_TwigExtensions extends AbstractExtension implements InjectionAwareInte public function twig_markdown_filter(Twig\Environment $env, $value) { - return $this->di['parse_markdown']($value); + return $this->di['parse_markdown']((string) $value); } public function twig_truncate_filter(Twig\Environment $env, $value, $length = 30, $preserve = false, $separator = '...')