diff --git a/src/Directive/ConfigurationBlockDirective.php b/src/Directive/ConfigurationBlockDirective.php index 3a999435..8b0c8cb9 100644 --- a/src/Directive/ConfigurationBlockDirective.php +++ b/src/Directive/ConfigurationBlockDirective.php @@ -54,6 +54,7 @@ public function processSub(Parser $parser, ?Node $document, string $variable, st $language = $node->getLanguage() ?? 'Unknown'; $blocks[] = [ + 'hash' => hash('sha1', $node->getValue()), 'language_label' => self::LANGUAGE_LABELS[$language] ?? ucfirst(str_replace('-', ' ', $language)), 'language' => $language, 'code' => $node->render(), diff --git a/src/Templates/default/html/directives/configuration-block.html.twig b/src/Templates/default/html/directives/configuration-block.html.twig index 4917382e..03a48d3e 100644 --- a/src/Templates/default/html/directives/configuration-block.html.twig +++ b/src/Templates/default/html/directives/configuration-block.html.twig @@ -1,14 +1,16 @@
- +
{% for block in blocks %} -
+
{{ block.code|raw }}
{% endfor %} diff --git a/tests/fixtures/expected/blocks/directives/configuration-block.html b/tests/fixtures/expected/blocks/directives/configuration-block.html index bdff934b..4b940ce5 100644 --- a/tests/fixtures/expected/blocks/directives/configuration-block.html +++ b/tests/fixtures/expected/blocks/directives/configuration-block.html @@ -1,9 +1,10 @@
- -
+
+ + +
+ +
1
@@ -11,7 +12,8 @@
-