wiki-grav/plugins/shortcode-core/classes/shortcodes/RawShortcode.php
2023-06-02 08:07:58 +02:00

18 lines
527 B
PHP

<?php
namespace Grav\Plugin\Shortcodes;
use Thunder\Shortcode\EventHandler\FilterRawEventHandler;
use Thunder\Shortcode\Events;
use Thunder\Shortcode\Shortcode\ShortcodeInterface;
class RawShortcode extends Shortcode
{
public function init()
{
$this->shortcode->getHandlers()->add('raw', static function(ShortcodeInterface $sc) {
return trim($sc->getContent());
});
$this->shortcode->getEvents()->addListener(Events::FILTER_SHORTCODES, new FilterRawEventHandler(['raw']));
}
}