mirror of
https://github.com/cwinfo/matterbridge.git
synced 2025-07-11 21:16:27 +00:00
Update dependencies and go1.18 (#1873)
* Update dependencies and go1.18 * Exclude unnecessary linters and update build to go1.18
This commit is contained in:
35
vendor/github.com/gomarkdown/markdown/parser/inline.go
generated
vendored
35
vendor/github.com/gomarkdown/markdown/parser/inline.go
generated
vendored
@ -899,7 +899,11 @@ func autoLink(p *Parser, data []byte, offset int) (int, ast.Node) {
|
||||
origData := data
|
||||
data = data[offset-rewind:]
|
||||
|
||||
if !isSafeLink(data) {
|
||||
isSafeURL := p.IsSafeURLOverride
|
||||
if isSafeURL == nil {
|
||||
isSafeURL = valid.IsSafeURL
|
||||
}
|
||||
if !isSafeURL(data) {
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
@ -995,35 +999,6 @@ func isEndOfLink(char byte) bool {
|
||||
return isSpace(char) || char == '<'
|
||||
}
|
||||
|
||||
func isSafeLink(link []byte) bool {
|
||||
nLink := len(link)
|
||||
for _, path := range valid.Paths {
|
||||
nPath := len(path)
|
||||
linkPrefix := link[:nPath]
|
||||
if nLink >= nPath && bytes.Equal(linkPrefix, path) {
|
||||
if nLink == nPath {
|
||||
return true
|
||||
} else if isAlnum(link[nPath]) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for _, prefix := range valid.URIs {
|
||||
// TODO: handle unicode here
|
||||
// case-insensitive prefix test
|
||||
nPrefix := len(prefix)
|
||||
if nLink > nPrefix {
|
||||
linkPrefix := bytes.ToLower(link[:nPrefix])
|
||||
if bytes.Equal(linkPrefix, prefix) && isAlnum(link[nPrefix]) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// return the length of the given tag, or 0 is it's not valid
|
||||
func tagLength(data []byte) (autolink autolinkType, end int) {
|
||||
var i, j int
|
||||
|
3
vendor/github.com/gomarkdown/markdown/parser/parser.go
generated
vendored
3
vendor/github.com/gomarkdown/markdown/parser/parser.go
generated
vendored
@ -84,6 +84,9 @@ type Parser struct {
|
||||
// the bottom will be used to fill in the link details.
|
||||
ReferenceOverride ReferenceOverrideFunc
|
||||
|
||||
// TODO: documentation
|
||||
IsSafeURLOverride func(url []byte) bool
|
||||
|
||||
Opts Options
|
||||
|
||||
// after parsing, this is AST root of parsed markdown text
|
||||
|
Reference in New Issue
Block a user