Remove new lines from domain name part of autolinker regular expression in Util\Strings
- Fixes issue where the autolinker would include the next paragraph is a pathless URL was followed by new lines.
This commit is contained in:
parent
4b5843ae30
commit
8f96e383a7
1 changed files with 9 additions and 9 deletions
|
@ -358,17 +358,17 @@ class Strings
|
||||||
return '@(?xi)
|
return '@(?xi)
|
||||||
(?<![=\'\]"/]) # Not preceded by [, =, \', ], ", /
|
(?<![=\'\]"/]) # Not preceded by [, =, \', ], ", /
|
||||||
\b
|
\b
|
||||||
( # Capture 1: entire matched URL
|
( # Capture 1: entire matched URL
|
||||||
https?:// # http or https protocol
|
https?:// # http or https protocol
|
||||||
(?:
|
(?:
|
||||||
[^/.][^/]+[.][^/]+/? # looks like domain name followed by a slash
|
[^/\s.][^/\s]+[.][^\s/]+/? # looks like domain name followed by a slash
|
||||||
)
|
)
|
||||||
(?: # One or more:
|
(?: # One or more:
|
||||||
[^\s()<>]+ # Run of non-space, non-()<>
|
[^\s()<>]+ # Run of non-space, non-()<>
|
||||||
| # or
|
| # or
|
||||||
\(([^\s()<>]+|(\([^\s()<>]+\)))*\) # balanced parens, up to 2 levels
|
\(([^\s()<>]+|(\([^\s()<>]+\)))*\) # balanced parens, up to 2 levels
|
||||||
| # or
|
| # or
|
||||||
[^\s`!()\[\]{};:\'".,<>?«»“”‘’] # not a space or one of these punct chars
|
[^\s`!()\[\]{};:\'".,<>?«»“”‘’] # not a space or one of these punct chars
|
||||||
)*
|
)*
|
||||||
)@';
|
)@';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue