1
0
mirror of https://github.com/erusev/parsedown.git synced 2023-08-10 21:13:06 +03:00
This commit is contained in:
Emanuil Rusev 2014-01-21 14:23:04 +02:00
parent 17e7e33847
commit 68f2871996
3 changed files with 8 additions and 0 deletions

View File

@ -891,6 +891,12 @@ class Parsedown
$offset = strlen($matches[0]);
}
elseif (strpos($text, '@') > 1 and preg_match('/<(\S+?@\S+?)>/', $text, $matches))
{
$markup .= '<a href="mailto:'.$matches[1].'">'.$matches[1].'</a>';
$offset = strlen($matches[0]);
}
elseif (preg_match('/^<\/?\w.*?>/', $text, $matches))
{
$markup .= $matches[0];

1
tests/data/email.html Normal file
View File

@ -0,0 +1 @@
<p>my email is <a href="mailto:me@example.com">me@example.com</a></p>

1
tests/data/email.md Normal file
View File

@ -0,0 +1 @@
my email is <me@example.com>