diff --git a/Parsedown.php b/Parsedown.php index 20db134..1b26581 100755 --- a/Parsedown.php +++ b/Parsedown.php @@ -982,7 +982,7 @@ class Parsedown return; } - if (preg_match('/\bhttps?:[\/]{2}[^\s]+\b\/*/ui', $text, $matches, PREG_OFFSET_CAPTURE)) + if (preg_match('/\bhttps?:[\/]{2}[^\s<]+\b\/*/ui', $text, $matches, PREG_OFFSET_CAPTURE)) { $url = str_replace(array('&', '<'), array('&', '<'), $matches[0][0]); diff --git a/test/data/span-level_html.html b/test/data/span-level_html.html index 590b634..f852a25 100644 --- a/test/data/span-level_html.html +++ b/test/data/span-level_html.html @@ -1,4 +1,5 @@

an important link

broken
line

-

inline tag at the beginning

\ No newline at end of file +

inline tag at the beginning

+

http://example.com

\ No newline at end of file diff --git a/test/data/span-level_html.md b/test/data/span-level_html.md index aadf6fc..f221965 100644 --- a/test/data/span-level_html.md +++ b/test/data/span-level_html.md @@ -3,4 +3,6 @@ an important link broken
line -inline tag at the beginning \ No newline at end of file +inline tag at the beginning + +http://example.com \ No newline at end of file