mirror of
https://github.com/KnpLabs/KnpMarkdownBundle.git
synced 2024-06-08 08:52:21 +02:00
Update Twig filters and extension
Hello,
I just updated this file to be compatible with Symfony 5.
The twig filters and extensions were deprecated.
Cheers 😉
This commit is contained in:
parent
a81befb20f
commit
6dba9b29bc
|
@ -3,8 +3,10 @@
|
||||||
namespace Knp\Bundle\MarkdownBundle\Twig\Extension;
|
namespace Knp\Bundle\MarkdownBundle\Twig\Extension;
|
||||||
|
|
||||||
use Knp\Bundle\MarkdownBundle\Parser\ParserManager;
|
use Knp\Bundle\MarkdownBundle\Parser\ParserManager;
|
||||||
|
use Twig\Extension\AbstractExtension;
|
||||||
|
use Twig\TwigFilter;
|
||||||
|
|
||||||
class MarkdownTwigExtension extends \Twig_Extension
|
class MarkdownTwigExtension extends AbstractExtension
|
||||||
{
|
{
|
||||||
private $parserManager;
|
private $parserManager;
|
||||||
|
|
||||||
|
@ -16,7 +18,7 @@ class MarkdownTwigExtension extends \Twig_Extension
|
||||||
public function getFilters()
|
public function getFilters()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
new \Twig_SimpleFilter('markdown', array($this, 'markdown'), array('is_safe' => array('html'))),
|
new TwigFilter('markdown', array($this, 'markdown'), array('is_safe' => array('html'))),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue