From cc94c1b5846dd7b3d883cd4b8b4199948ead42ac Mon Sep 17 00:00:00 2001 From: Emanuil Rusev Date: Fri, 2 May 2014 18:21:10 +0300 Subject: [PATCH] resolve #167 --- Parsedown.php | 2 +- test/data/span-level_html.html | 3 ++- test/data/span-level_html.md | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) 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