mirror of
https://github.com/KnpLabs/KnpMarkdownBundle.git
synced 2024-06-10 01:42:16 +02:00
Merged pull request #10 from GromNaN/master.
Don't load MarkdownExtraParser.php if the class MarkdownExtraParser already exists.
This commit is contained in:
commit
d5e735d22c
|
@ -2,7 +2,9 @@
|
||||||
|
|
||||||
namespace Knplabs\Bundle\MarkdownBundle\Parser;
|
namespace Knplabs\Bundle\MarkdownBundle\Parser;
|
||||||
|
|
||||||
require_once(realpath(__DIR__.'/..').'/vendor/parser/MarkdownExtraParser.php');
|
if(!class_exists('\MarkdownExtraParser')) {
|
||||||
|
require_once(realpath(__DIR__.'/..').'/vendor/parser/MarkdownExtraParser.php');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MarkdownParser
|
* MarkdownParser
|
||||||
|
|
|
@ -24,7 +24,7 @@ You can also define your own Parser class :
|
||||||
## USAGE
|
## USAGE
|
||||||
|
|
||||||
// Use the service
|
// Use the service
|
||||||
$html = $this->container['markdownParser']->transform($text);
|
$html = $this->container->get('markdownParser')->transform($text);
|
||||||
|
|
||||||
// Use the helper
|
// Use the helper
|
||||||
echo $view['markdown']->transform($text);
|
echo $view['markdown']->transform($text);
|
||||||
|
|
Loading…
Reference in a new issue