From 68b694e0313381234cb154cab7c25bbcc053f698 Mon Sep 17 00:00:00 2001 From: Fabian Schmick Date: Fri, 12 Jun 2026 12:08:53 +0000 Subject: [PATCH] Add brackets to the Guide-Example only if these are still missing --- src/Controller/GuideController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Controller/GuideController.php b/src/Controller/GuideController.php index 3a1f101..a6c0676 100644 --- a/src/Controller/GuideController.php +++ b/src/Controller/GuideController.php @@ -68,7 +68,10 @@ public function detailAction(string $shortcode, Request $request): Response $shortcodeTag['example'] = $shortcode.' '.$customParameters; } - $example = '['.($shortcodeTag['example'] ?? $shortcode).']'; + $example = $shortcodeTag['example'] ?? $shortcode; + if (!str_starts_with($example, '[')) { + $example = '['.$example.']'; + } if ($this->formFactory) { $formBuilder = $this->formFactory->createBuilder(FormType::class, ['example' => $example], ['method' => 'GET']);