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
2 changed files with 8 additions and 1 deletions
|
@ -361,7 +361,10 @@ class Strings
|
|||
( # Capture 1: entire matched URL
|
||||
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:
|
||||
[^\s()<>]+ # Run of non-space, non-()<>
|
||||
|
|
|
@ -102,6 +102,10 @@ class BBCodeTest extends MockedTest
|
|||
'data' => "http://example.com\ntest",
|
||||
'assertHTML' => false
|
||||
],
|
||||
'bug-6901' => [
|
||||
'data' => "http://example.com<ul>",
|
||||
'assertHTML' => false
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue