Skip to content

Commit 3a7bd0f

Browse files
committed
Fix trailing point #2
1 parent 5e50986 commit 3a7bd0f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Autolink.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function convertEmail($text, $attribs = array())
103103
{
104104
$self = $this;
105105

106-
$regex = "/(([a-zA-Z]*=\")*[a-zA-Z0-9!#$%&'*+-\/=?^_`{|}~:]+@[a-zA-Z0-9!#$%&'*+-\/=?^_`{|}~\">]+)/";
106+
$regex = "/(([a-zA-Z]*=\")*[a-zA-Z0-9!#$%&'*+-\/=?^_`{|}~:]+@[a-zA-Z0-9!#$%&'*+-\/=?^_`{|}~]+\.[a-zA-Z\">]{2,})/";
107107

108108
return preg_replace_callback(
109109
$regex,

test/AutolinkTest.php

+4
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,8 @@ public function testConvertEmail()
258258
<div data-target="sakura@flower.com" wdith="100"/></div>
259259
<div data-target="mailto:sakura@flower.com" wdith="100"/></div>
260260
261+
My email address is sakura@flower.com.
262+
261263
and emails are coming in between(sakura@flower.com).
262264
TEXT;
263265

@@ -273,6 +275,8 @@ public function testConvertEmail()
273275
<div data-target="sakura@flower.com" wdith="100"/></div>
274276
<div data-target="mailto:sakura@flower.com" wdith="100"/></div>
275277
278+
My email address is <a href="mailto:sakura@flower.com">sakura@flower.com</a>.
279+
276280
and emails are coming in between(<a href="mailto:sakura@flower.com">sakura@flower.com</a>).
277281
HTML;
278282

0 commit comments

Comments
 (0)