Add support for parsedown and parsedown-extra in Symfony 2.
Provides :
- Two services:
- parsedown.standart : parsedown parser.
- parsedown.extra : parsedown-extra parser (support for Markdown Extra).
- Two twig filter:
- md : parse markdown with standart parser.
- mde : parse markdown with extra parser.
Add the bundle in your composer.json :
"require": {
"bgaze/parsedown-bundle": "dev-master"
}
Update your vendors, then enable bundle in AppKernel.php :
new Bgaze\ParsedownBundle\BgazeParsedownBundle(),
In twig templates:
{# Parse markdown using parsedown standart parser #}
{{ var|md }}
{# Parse markdown using parsedown-extra parser #}
{{ var|mde }}
In PHP :
// Parse markdown using parsedown standart parser.
echo $container->get('parsedown.standart')->text($var);
// Parse markdown using parsedown-extra parser.
echo $container->get('parsedown.extra')->text($var);