diff --git a/flextype/dependencies.php b/flextype/dependencies.php index a617ce36..64a40e55 100644 --- a/flextype/dependencies.php +++ b/flextype/dependencies.php @@ -34,7 +34,6 @@ use League\Glide\Responses\SlimResponseFactory; use League\Glide\ServerFactory; use Monolog\Handler\StreamHandler; use Monolog\Logger; -use ParsedownExtra as Markdown; use Slim\Csrf\Guard; use Slim\Flash\Messages; use Slim\Http\Environment; @@ -202,12 +201,6 @@ $flextype['shortcodes'] = static function ($container) { return new ShortcodeFacade(); }; -/** - * Add Markdown service to Flextype container - */ -$flextype['markdown'] = static function ($container) { - return new Markdown(); -}; /** * Add entries service to Flextype container diff --git a/flextype/parsers/MarkdownParser.php b/flextype/parsers/MarkdownParser.php new file mode 100644 index 00000000..d9f7d186 --- /dev/null +++ b/flextype/parsers/MarkdownParser.php @@ -0,0 +1,36 @@ +text($input); + } +} diff --git a/flextype/twig/MarkdownTwigExtension.php b/flextype/twig/MarkdownTwigExtension.php index 1958576c..786c6ea7 100644 --- a/flextype/twig/MarkdownTwigExtension.php +++ b/flextype/twig/MarkdownTwigExtension.php @@ -44,10 +44,6 @@ class MarkdownTwigExtension extends Twig_Extension */ public function markdown($value) : string { - if ($value !== null) { - return $this->flextype->markdown->text($value); - } - - return ''; + return MarkdownParser::parse($value); } }