From fdf75e8b5b3b8889f59cffa8314623146b5108fa Mon Sep 17 00:00:00 2001 From: kaamaru Date: Sat, 16 Nov 2013 22:20:00 +0000 Subject: [PATCH] Update Parsedown.php This solves a bug which stops referenced links formatting correctly when a space is inserted before a reference to a link right after a list. This is caused because parsedown think's it's a secondary list rather, so it jumps to the next line. Here is an example: + [Google][2] + [Youtube][1] [1]: http://youtube.com [2]: http://google.com --- Parsedown.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Parsedown.php b/Parsedown.php index e667b3f..e12a5ce 100755 --- a/Parsedown.php +++ b/Parsedown.php @@ -182,7 +182,7 @@ class Parsedown if (isset($element['interrupted'])) { - if ($line[0] === ' ') + if ($line[0] === ' ' and ! preg_match('/^[ ]{0,4}\[(.+?)\]:[ ]*([^ ]+)/', $line)) { $element['lines'] []= ''; @@ -692,4 +692,4 @@ class Parsedown return $text; } -} \ No newline at end of file +}