protected static function registerMarkdownEngine(EngineResolver $engines, ContainerInterface $container): void
    {
        $markdown = null;

        if ($container->has(ParsedownExtra::class)) {
            $markdown = $container->get(ParsedownExtra::class);
        } elseif ($container->has(Parsedown::class)) {
            $markdown = $container->get(Parsedown::class);
        }

        $engines->register('md', static function () use ($markdown) {
            return new MarkdownEngine($markdown);
        });
    }