Skip to content

Commit

Permalink
Merge pull request #11 from nedf23/master
Browse files Browse the repository at this point in the history
Fix for blade directives.
  • Loading branch information
maherelgamil authored Dec 14, 2016
2 parents 9c88b5d + be7f9a0 commit 831bf22
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/MarkdownServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,25 @@ protected function registerBladeWidgets()
{
// Markdown Style Blade Directive
Blade::directive('markdownstyle', function ($file) {
if (!is_null($file)) {
return "<?php echo Laradown::loadStyle{$file}; ?>";
if (!empty($file)) {
return "<?php echo Markdown::loadStyle({$file}); ?>";
}

return '<?php Markdown::loadStyle() ?>';
return '<?php Markdown::loadStyle(); ?>';
});

// Markdown Start Blade Directive
Blade::directive('markdown', function ($markdown) {
if (!is_null($markdown)) {
return "<?php echo Laradown::convert{$markdown}; ?>";
if (!empty($markdown)) {
return "<?php echo Markdown::convert($markdown); ?>";
}

return '<?php Markdown::collect() ?>';
return '<?php Markdown::collect(); ?>';
});

// Markdown End Blade Directive
Blade::directive('endmarkdown', function () {
return '<?php echo Laradown::endCollect() ?>';
return '<?php echo Markdown::endCollect(); ?>';
});
}
}

0 comments on commit 831bf22

Please sign in to comment.