summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/gomarkdown/markdown/parser/inline.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2022-06-11 23:07:42 +0200
committerGitHub <noreply@github.com>2022-06-11 23:07:42 +0200
commit8751fb4bb1eb7cd34ed63be9b3801b8aeac71a1d (patch)
tree601d2616b05b5b197bd2a3ae7cb245b1a0ea17e7 /vendor/github.com/gomarkdown/markdown/parser/inline.go
parent3819062574ac7e4af6a562bf40a425469a7752fb (diff)
downloadmatterbridge-msglm-8751fb4bb1eb7cd34ed63be9b3801b8aeac71a1d.tar.gz
matterbridge-msglm-8751fb4bb1eb7cd34ed63be9b3801b8aeac71a1d.tar.bz2
matterbridge-msglm-8751fb4bb1eb7cd34ed63be9b3801b8aeac71a1d.zip
Update dependencies (#1841)
Diffstat (limited to 'vendor/github.com/gomarkdown/markdown/parser/inline.go')
-rw-r--r--vendor/github.com/gomarkdown/markdown/parser/inline.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/vendor/github.com/gomarkdown/markdown/parser/inline.go b/vendor/github.com/gomarkdown/markdown/parser/inline.go
index 1f23935c..ae7f244e 100644
--- a/vendor/github.com/gomarkdown/markdown/parser/inline.go
+++ b/vendor/github.com/gomarkdown/markdown/parser/inline.go
@@ -6,6 +6,7 @@ import (
"strconv"
"github.com/gomarkdown/markdown/ast"
+ "github.com/gomarkdown/markdown/internal/valid"
)
// Parsing of inline elements
@@ -994,12 +995,9 @@ func isEndOfLink(char byte) bool {
return isSpace(char) || char == '<'
}
-var validUris = [][]byte{[]byte("http://"), []byte("https://"), []byte("ftp://"), []byte("mailto://")}
-var validPaths = [][]byte{[]byte("/"), []byte("./"), []byte("../")}
-
func isSafeLink(link []byte) bool {
nLink := len(link)
- for _, path := range validPaths {
+ for _, path := range valid.Paths {
nPath := len(path)
linkPrefix := link[:nPath]
if nLink >= nPath && bytes.Equal(linkPrefix, path) {
@@ -1011,7 +1009,7 @@ func isSafeLink(link []byte) bool {
}
}
- for _, prefix := range validUris {
+ for _, prefix := range valid.URIs {
// TODO: handle unicode here
// case-insensitive prefix test
nPrefix := len(prefix)
@@ -1119,7 +1117,7 @@ func isMailtoAutoLink(data []byte) int {
nb++
case '-', '.', '_':
- break
+ // no-op but not defult
case '>':
if nb == 1 {