mirror of
https://github.com/cwinfo/matterbridge.git
synced 2025-08-02 09:13:44 +00:00
Update vendor for next release (#1343)
This commit is contained in:
12
vendor/github.com/mattermost/mattermost-server/v5/utils/markdown/autolink.go
generated
vendored
12
vendor/github.com/mattermost/mattermost-server/v5/utils/markdown/autolink.go
generated
vendored
@@ -14,6 +14,7 @@ import (
|
||||
|
||||
var (
|
||||
DefaultUrlSchemes = []string{"http", "https", "ftp", "mailto", "tel"}
|
||||
wwwAutoLinkRegex = regexp.MustCompile(`^www\d{0,3}\.`)
|
||||
)
|
||||
|
||||
// Given a string with a w at the given position, tries to parse and return a range containing a www link.
|
||||
@@ -30,7 +31,7 @@ func parseWWWAutolink(data string, position int) (Range, bool) {
|
||||
}
|
||||
|
||||
// Check that this starts with www
|
||||
if len(data)-position < 4 || !regexp.MustCompile(`^www\d{0,3}\.`).MatchString(data[position:]) {
|
||||
if len(data)-position < 4 || !wwwAutoLinkRegex.MatchString(data[position:]) {
|
||||
return Range{}, false
|
||||
}
|
||||
|
||||
@@ -59,9 +60,8 @@ func isAllowedBeforeWWWLink(c byte) bool {
|
||||
switch c {
|
||||
case '*', '_', '~', ')':
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Given a string with a : at the given position, tried to parse and return a range containing a URL scheme
|
||||
@@ -153,9 +153,8 @@ func checkDomain(data string, allowShort bool) int {
|
||||
// this is called from parseWWWAutolink
|
||||
if foundPeriod {
|
||||
return i
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// Returns true if the provided link starts with a valid character for a domain name. Equivalent to
|
||||
@@ -251,7 +250,6 @@ func canEndAutolink(c rune) bool {
|
||||
switch c {
|
||||
case '?', '!', '.', ',', ':', '*', '_', '~', '\'', '"':
|
||||
return false
|
||||
default:
|
||||
return true
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
Reference in New Issue
Block a user