Skip to content

Commit ee044c1

Browse files
committed
Forwarding CSS classes to CodeNode
1 parent 6367bc3 commit ee044c1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Directive/CodeBlockDirective.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ public function process(Parser $parser, ?Node $node, string $variable, string $d
3333
}
3434

3535
$node->setLanguage($data);
36+
// grab the "class" option and forward it onto the Node
37+
// CodeNodeRenderer can then use it when rendering
38+
$node->setClasses(isset($options['class']) ? explode(' ', $options['class']) : []);
3639

3740
if ('' !== $variable) {
3841
$environment = $parser->getEnvironment();

0 commit comments

Comments
 (0)