mirror of
https://github.com/KnpLabs/KnpMarkdownBundle.git
synced 2024-05-19 05:46:33 +02:00
add check to prevent usage when using sundown
This commit is contained in:
parent
21e026f8b2
commit
52f68ec920
|
@ -3,6 +3,7 @@
|
|||
namespace Knp\Bundle\MarkdownBundle\DependencyInjection;
|
||||
|
||||
use Symfony\Component\Config\Definition\Processor;
|
||||
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
|
||||
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
||||
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
|
||||
use Symfony\Component\Config\FileLocator;
|
||||
|
@ -30,5 +31,9 @@ class KnpMarkdownExtension extends Extension
|
|||
$container->setParameter('markdown.sundown.extensions', $config['sundown']['extensions']);
|
||||
$container->setParameter('markdown.sundown.render_flags', $config['sundown']['render_flags']);
|
||||
$container->setAlias('markdown.parser', $config['parser']['service']);
|
||||
|
||||
if ($config['parser']['service'] == 'markdown.parser.sundown' && !class_exists('Sundown\Markdown')) {
|
||||
throw new InvalidConfigurationException('<strong>Sundown</strong> extension not installed or configured.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue