Merge pull request #6904 from MrPetovan/bug/6901-autolinker-fix-punctuation-domain
Exclude punctuation from domain in autolinker regular expression
This commit is contained in:
commit
d32105aa8b
|
@ -361,7 +361,10 @@ class Strings
|
||||||
( # Capture 1: entire matched URL
|
( # Capture 1: entire matched URL
|
||||||
https?:// # http or https protocol
|
https?:// # http or https protocol
|
||||||
(?:
|
(?:
|
||||||
[^/\s.][^/\s]+[.][^\s/]+/? # looks like domain name followed by a slash
|
[^/\s`!()\[\]{};:\'",<>?«»“”‘’.] # Domain can\'t start with a .
|
||||||
|
[^/\s`!()\[\]{};:\'",<>?«»“”‘’]+ # Domain can\'t end with a .
|
||||||
|
\.
|
||||||
|
[^/\s`!()\[\]{};:\'".,<>?«»“”‘’]+/? # Followed by a slash
|
||||||
)
|
)
|
||||||
(?: # One or more:
|
(?: # One or more:
|
||||||
[^\s()<>]+ # Run of non-space, non-()<>
|
[^\s()<>]+ # Run of non-space, non-()<>
|
||||||
|
|
|
@ -102,6 +102,10 @@ class BBCodeTest extends MockedTest
|
||||||
'data' => "http://example.com\ntest",
|
'data' => "http://example.com\ntest",
|
||||||
'assertHTML' => false
|
'assertHTML' => false
|
||||||
],
|
],
|
||||||
|
'bug-6901' => [
|
||||||
|
'data' => "http://example.com<ul>",
|
||||||
|
'assertHTML' => false
|
||||||
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user