Skip to content

Commit

Permalink
Adding functionality to allow the Str::markdown() method to accept ex…
Browse files Browse the repository at this point in the history
…tensions.
  • Loading branch information
tnylea authored Jun 25, 2024
1 parent 7100359 commit 01577ae
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Illuminate/Support/Str.php
Original file line number Diff line number Diff line change
Expand Up @@ -637,10 +637,16 @@ public static function words($value, $words = 100, $end = '...')
* @param array $options
* @return string
*/
public static function markdown($string, array $options = [])
public static function markdown($string, array $options = [], array $extensions = [])
{
$converter = new GithubFlavoredMarkdownConverter($options);

$environment = $converter->getEnvironment();

foreach ($extensions as $extension) {
$environment->addExtension($extension);
}

return (string) $converter->convert($string);
}

Expand Down

0 comments on commit 01577ae

Please sign in to comment.