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:
25
src/flextype/core/Parsers/Shortcodes/MarkdownShortcode.php
Normal file
25
src/flextype/core/Parsers/Shortcodes/MarkdownShortcode.php
Normal 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());
|
||||
});
|
@@ -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"
|
||||
|
Reference in New Issue
Block a user