Skip to content

Commit 68b694e

Browse files
committed
Add brackets to the Guide-Example only if these are still missing
1 parent b21f876 commit 68b694e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎src/Controller/GuideController.php‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ public function detailAction(string $shortcode, Request $request): Response
6868
$shortcodeTag['example'] = $shortcode.' '.$customParameters;
6969
}
7070

71-
$example = '['.($shortcodeTag['example'] ?? $shortcode).']';
71+
$example = $shortcodeTag['example'] ?? $shortcode;
72+
if (!str_starts_with($example, '[')) {
73+
$example = '['.$example.']';
74+
}
7275

7376
if ($this->formFactory) {
7477
$formBuilder = $this->formFactory->createBuilder(FormType::class, ['example' => $example], ['method' => 'GET']);

0 commit comments

Comments
 (0)