Skip to content

Commit

Permalink
Code block parsing should be less greedy, fixes #1
Browse files Browse the repository at this point in the history
  • Loading branch information
lux committed Mar 30, 2022
1 parent cc5da2d commit e48c300
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Slimdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/
class Slimdown {
public static $rules = array (
'/```(.*)```/s' => 'self::code_parse', // code blocks
'/```(.*?)```/s' => 'self::code_parse', // code blocks
'/\n(#+)(.*)/' => 'self::header', // headers
'/\!\[([^\[]+)\]\(([^\)]+)\)/' => '<img src=\'\2\' alt=\'\1\' />', // images
'/\[([^\[]+)\]\(([^\)]+)\)/' => '<a href=\'\2\'>\1</a>', // links
Expand Down

0 comments on commit e48c300

Please sign in to comment.