diff --git a/Parsedown.php b/Parsedown.php index aafc32b..05cf8ac 100755 --- a/Parsedown.php +++ b/Parsedown.php @@ -1046,7 +1046,7 @@ class Parsedown case 'http': - if (preg_match('/^https?:[\/]{2}[^\s]+\b/ui', $text, $matches)) + if (preg_match('/^https?:[\/]{2}[^\s]+\b\/*/ui', $text, $matches)) { $element_url = $matches[0]; $element_url = str_replace('&', '&', $element_url); diff --git a/tests/data/url_autolinking.html b/tests/data/url_autolinking.html index 9862cc4..58ca94c 100644 --- a/tests/data/url_autolinking.html +++ b/tests/data/url_autolinking.html @@ -1,2 +1,3 @@

an autolink http://example.com

-

inside of brackets [http://example.com], inside of braces {http://example.com}, inside of parentheses (http://example.com)

\ No newline at end of file +

inside of brackets [http://example.com], inside of braces {http://example.com}, inside of parentheses (http://example.com)

+

trailing slash http://example.com/ and http://example.com/path/

\ No newline at end of file diff --git a/tests/data/url_autolinking.md b/tests/data/url_autolinking.md index 8cc442a..840f354 100644 --- a/tests/data/url_autolinking.md +++ b/tests/data/url_autolinking.md @@ -1,3 +1,5 @@ an autolink http://example.com -inside of brackets [http://example.com], inside of braces {http://example.com}, inside of parentheses (http://example.com) \ No newline at end of file +inside of brackets [http://example.com], inside of braces {http://example.com}, inside of parentheses (http://example.com) + +trailing slash http://example.com/ and http://example.com/path/ \ No newline at end of file