From 0172d779d73d8d7ad94f9c486f8560a77d184389 Mon Sep 17 00:00:00 2001 From: Aidan Woods Date: Sat, 21 Jan 2017 11:06:41 +0000 Subject: [PATCH] Trim surrounding whitespace from URL in inlineLink Fixes https://github.com/erusev/parsedown-extra/issues/103 --- Parsedown.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Parsedown.php b/Parsedown.php index d7b5537..3e25b0d 100644 --- a/Parsedown.php +++ b/Parsedown.php @@ -1217,7 +1217,7 @@ class Parsedown return; } - if (preg_match('/^[(]((?:[^ ()]++|[(][^ )]+[)])++)(?:[ ]+("[^"]*"|\'[^\']*\'))?[)]/', $remainder, $matches)) + if (preg_match('/^[(]\s*+((?:[^ ()]++|[(][^ )]+[)])++)(?:[ ]+("[^"]*"|\'[^\']*\'))?\s*[)]/', $remainder, $matches)) { $Element['attributes']['href'] = $matches[1];