1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-07 21:56:33 +02:00

feat(shortcodes): add ability to parse nested shortcodes for markdown s…

This commit is contained in:
Awilum
2022-05-25 20:27:37 +03:00
parent 96a990812d
commit ebab3740e8

View File

@@ -19,11 +19,12 @@ namespace Flextype\Parsers\Shortcodes;
use Thunder\Shortcode\Shortcode\ShortcodeInterface;
use function parsers;
// Shortcode: [markdown] markdown text here [/markdown]
// Shortcode: (markdown)
// Usage: (markdown) markdown text here (/markdown)
parsers()->shortcodes()->addHandler('markdown', static function (ShortcodeInterface $s) {
if (! registry()->get('flextype.settings.parsers.shortcodes.shortcodes.markdown.enabled')) {
return '';
}
return parsers()->markdown()->parse($s->getContent());
return parsers()->markdown()->parse(parsers()->shortcodes()->parse($s->getContent()));
});