diff --git a/DependencyInjection/MarkdownExtension.php b/DependencyInjection/MarkdownExtension.php index bc36654..76abc01 100644 --- a/DependencyInjection/MarkdownExtension.php +++ b/DependencyInjection/MarkdownExtension.php @@ -13,6 +13,11 @@ class MarkdownExtension extends Extension { $loader = new XmlFileLoader($container, __DIR__.'/../Resources/config'); $loader->load('parser.xml'); + + if(isset($config['class'])) + { + $container->setParameter('markdown.parser.class', $config['class']); + } } public function helperLoad($config, ContainerBuilder $container) diff --git a/README.markdown b/README.markdown index 1d32955..67ee901 100644 --- a/README.markdown +++ b/README.markdown @@ -14,6 +14,11 @@ Optionnally enable the twig markdown filter : twig.config: ~ # Enable Twig markdown.twig: ~ # Enable the markdown filter +You can also define your own Parser class : + + markdown.parser: + class: Bundle\HelloBundle\MarkdownParser + ## USAGE // Use the service