Skip to content

Commit

Permalink
did some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
realFlowControl authored Sep 25, 2017
1 parent 6defab8 commit 6d9951d
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions FlowControlSpressTwigMarkdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

class FlowControlSpressTwigMarkdown implements PluginInterface
{
private $io;

public function initialize(EventSubscriber $subscriber)
{
$subscriber->addEventListener('spress.start', 'onStart');
Expand All @@ -17,19 +15,17 @@ public function initialize(EventSubscriber $subscriber)
public function getMetas()
{
return [
'name' => 'flow-control/spress-twig-markdown',
'description' => 'Spress plugin to add `markdown` filter function to Twig templates',
'author' => 'Florian Engelhardt',
'license' => 'GPL-3.0',
'name' => 'flow-control/spress-twig-markdown',
'description' => 'Spress plugin to add `markdown` filter function to Twig templates',
'author' => 'Florian Engelhardt',
'license' => 'GPL-3.0'
];
}

public function onStart(EnvironmentEvent $event)
{
$renderizer = $event->getRenderizer();
$renderizer->addTwigFilter('markdown', function ($string) {
$event->getRenderizer()->addTwigFilter('markdown', function ($string) {
return MarkdownExtra::defaultTransform($string);
});
}

}

0 comments on commit 6d9951d

Please sign in to comment.