diff --git a/src/Misd/Linkify/Linkify.php b/src/Misd/Linkify/Linkify.php
index 870bd38..af7bd55 100644
--- a/src/Misd/Linkify/Linkify.php
+++ b/src/Misd/Linkify/Linkify.php
@@ -160,7 +160,7 @@ protected function linkifyUrls($text, $options = array('attr' => ''))
| # or
[^\s`!\-()\[\]{};:\'".,<>?«»“”‘’] # not a space or one of these punct chars
)
- ~';
+ ~u';
$callback = function ($match) use ($options) {
$caption = $match[0];
@@ -201,7 +201,7 @@ protected function linkifyEmails($text, $options = array('attr' => ''))
[A-Z0-9.-]+ # Domain
\. # Dot
[A-Z]{2,4} # Something
- ~';
+ ~u';
$callback = function ($match) use ($options) {
if (isset($options['callback'])) {
diff --git a/tests/data/email.json b/tests/data/email.json
index 5edc6d2..6562f22 100644
--- a/tests/data/email.json
+++ b/tests/data/email.json
@@ -46,6 +46,14 @@
"test": "example@example.example.com.",
"expected": "example@example.example.com."
},
+ {
+ "test": "example@example.example.com ",
+ "expected": "example@example.example.com "
+ },
+ {
+ "test": "Привет example@example.com!",
+ "expected": "Привет example@example.com!"
+ },
{
"test": "(example@example.com)",
"expected": "(example@example.com)"
diff --git a/tests/data/url.json b/tests/data/url.json
index 50b3421..2dcfc71 100644
--- a/tests/data/url.json
+++ b/tests/data/url.json
@@ -38,6 +38,14 @@
"test": "http://www.example.com/example/",
"expected": "http://www.example.com/example/"
},
+ {
+ "test": "www.example.com ",
+ "expected": "www.example.com "
+ },
+ {
+ "test": "Линк: https://ru.wikipedia.org/wiki/Футбол",
+ "expected": "Линк: https://ru.wikipedia.org/wiki/Футбол"
+ },
{
"test": "(http://www.example.com/)",
"expected": "(http://www.example.com/)"