Add custom rtl shortcode

This commit is contained in:
Julien Gomes Dias 2021-02-07 16:20:52 +01:00
parent f0b93761b1
commit b729586690
2 changed files with 15 additions and 0 deletions

View file

@ -0,0 +1 @@
custom_shortcodes: '/user/custom/shortcodes'

View file

@ -0,0 +1,14 @@
<?php
namespace Grav\Plugin\Shortcodes;
use Thunder\Shortcode\Shortcode\ShortcodeInterface;
class RTLShortcode extends Shortcode
{
public function init()
{
$this->shortcode->getHandlers()->add('rtl', function(ShortcodeInterface $sc) {
return '<div dir="rtl">'.$sc->getContent().'</div>';
});
}
}