Last active
January 21, 2021 15:40
-
-
Save trovster/87d5bc892efd49bd6259fea7c264e8cb to your computer and use it in GitHub Desktop.
Laravel Markdown String Macro: https://laravel-news.com/laravel-markdown-to-html-macro
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| return [ | |
| 'html_input' => 'strip', | |
| 'allow_unsafe_links' => false, | |
| ]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| use League\CommonMark\GithubFlavoredMarkdownConverter; | |
| Str::macro('markdown', static function (string $content): string { | |
| $converter = new GithubFlavoredMarkdownConverter(config('markdown'))); | |
| return $converter->convertToHtml($content); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment