Issues with DefaultAttributes CommonMark Extension #10247
-
Hello, I'm trying to enable the bundled DefaultAttributes CommonMark extension but it's not working. I have successfully enabled other extensions (AttributesExtension, ExternalLinks, Footnotes etc.) in the same way and these work. It's just the DefaultAttributes that I'm having issues with. However, I don't get an error message. When I inspect my pages I see that the classes are not being injected as they should be. You'll find the two files I'm modifying to try to enable the DefaultAttributes extension below. I'm trying to add the class 'blockquote' as the default class for all blockquote elements. markdown.php
AppServiceProvider.php
Has anyone managed to enable this extension? I'd be grateful for any help or hints you can offer. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
It seems to work fine here. Make sure you are importing the + use League\CommonMark\Extension\CommonMark\Node\Block\BlockQuote;
<?php
return [
'configs' => [
'default' => [
'default_attributes' => [
BlockQuote::class => [
'class' => 'blockquote',
],
],
],
],
]; |
Beta Was this translation helpful? Give feedback.
-
This works. Thank you! I didn't realize I needed to add the Blockquote classs in markdown.php.. |
Beta Was this translation helpful? Give feedback.
It seems to work fine here. Make sure you are importing the
BlockQuote
class in your config file.+ use League\CommonMark\Extension\CommonMark\Node\Block\BlockQuote; <?php return [ 'configs' => [ 'default' => [ 'default_attributes' => [ BlockQuote::class => [ 'class' => 'blockquote', ], ], ], ], ];