1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-07 13:46:42 +02:00

feat(shortcodes): add [markdown] shortcode

This commit is contained in:
Awilum
2022-04-12 12:11:00 +03:00
parent b5d3678f4c
commit 87b754e437
2 changed files with 28 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
<?php
declare(strict_types=1);
/**
* Flextype - Hybrid Content Management System with the freedom of a headless CMS
* and with the full functionality of a traditional CMS!
*
* Copyright (c) Sergey Romanenko (https://awilum.github.io)
*
* Licensed under The MIT License.
*
* For full copyright and license information, please see the LICENSE
* Redistributions of files must retain the above copyright notice.
*/
namespace Flextype\Parsers\Shortcodes;
use Thunder\Shortcode\Shortcode\ShortcodeInterface;
use function parsers;
// Shortcode: [markdown] markdown text here [/markdown]
parsers()->shortcodes()->addHandler('markdown', static function (ShortcodeInterface $s) {
return parsers()->markdown()->parse($s->getContent());
});

View File

@@ -522,6 +522,9 @@ parsers:
raw:
enabled: true
path: "/src/flextype/core/Parsers/Shortcodes/RawShortcode.php"
markdown:
enabled: true
path: "/src/flextype/core/Parsers/Shortcodes/MarkdownShortcode.php"
registry:
enabled: true
path: "/src/flextype/core/Parsers/Shortcodes/RegistryShortcode.php"