summaryrefslogtreecommitdiffstats
path: root/vendor
diff options
context:
space:
mode:
authorAntoine GIRARD <sapk@users.noreply.github.com>2019-10-14 02:38:15 +0200
committerLunny Xiao <xiaolunwen@gmail.com>2019-10-14 08:38:15 +0800
commitba201aaa44b19f633fab0c4682d5f97558b3205e (patch)
treeb7fd1833c37158c2db27dc1158fd58fe1557002b /vendor
parent15809d81f7d36759f289b941352a9754611c5dba (diff)
downloadgitea-ba201aaa44b19f633fab0c4682d5f97558b3205e.tar.gz
gitea-ba201aaa44b19f633fab0c4682d5f97558b3205e.zip
vendor: update mvdan.cc/xurls/v2 to v2.1.0 (#8495)
Diffstat (limited to 'vendor')
-rw-r--r--vendor/modules.txt2
-rw-r--r--vendor/mvdan.cc/xurls/v2/.travis.yml17
-rw-r--r--vendor/mvdan.cc/xurls/v2/README.md18
-rw-r--r--vendor/mvdan.cc/xurls/v2/go.mod2
-rw-r--r--vendor/mvdan.cc/xurls/v2/schemes.go23
-rw-r--r--vendor/mvdan.cc/xurls/v2/tlds.go19
-rw-r--r--vendor/mvdan.cc/xurls/v2/xurls.go10
7 files changed, 48 insertions, 43 deletions
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 8b2224f54a..30b1370933 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -610,7 +610,7 @@ gopkg.in/testfixtures.v2
gopkg.in/warnings.v0
# gopkg.in/yaml.v2 v2.2.2
gopkg.in/yaml.v2
-# mvdan.cc/xurls/v2 v2.0.0
+# mvdan.cc/xurls/v2 v2.1.0
mvdan.cc/xurls/v2
# strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251
strk.kbt.io/projects/go/libravatar
diff --git a/vendor/mvdan.cc/xurls/v2/.travis.yml b/vendor/mvdan.cc/xurls/v2/.travis.yml
deleted file mode 100644
index e9bd7a7650..0000000000
--- a/vendor/mvdan.cc/xurls/v2/.travis.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-language: go
-
-go:
- - 1.10.x
- - 1.11.x
-
-go_import_path: mvdan.cc/xurls
-
-env:
- - GO111MODULE=on
-
-install: true
-
-script:
- - go get -t -d ./...
- - go build ./...
- - go test ./...
diff --git a/vendor/mvdan.cc/xurls/v2/README.md b/vendor/mvdan.cc/xurls/v2/README.md
index 5058efe7a7..07fbdb3b25 100644
--- a/vendor/mvdan.cc/xurls/v2/README.md
+++ b/vendor/mvdan.cc/xurls/v2/README.md
@@ -1,18 +1,20 @@
# xurls
[![GoDoc](https://godoc.org/mvdan.cc/xurls?status.svg)](https://godoc.org/mvdan.cc/xurls)
-[![Travis](https://travis-ci.org/mvdan/xurls.svg?branch=master)](https://travis-ci.org/mvdan/xurls)
-Extract urls from text using regular expressions. Requires Go 1.10.3 or later.
+Extract urls from text using regular expressions. Requires Go 1.12 or later.
```go
import "mvdan.cc/xurls/v2"
func main() {
- xurls.Relaxed().FindString("Do gophers live in golang.org?")
- // "golang.org"
- xurls.Strict().FindAllString("foo.com is http://foo.com/.", -1)
- // []string{"http://foo.com/"}
+ rxRelaxed := xurls.Relaxed()
+ rxRelaxed.FindString("Do gophers live in golang.org?") // "golang.org"
+ rxRelaxed.FindString("This string does not have a URL") // ""
+
+ rxStrict := xurls.Strict()
+ rxStrict.FindAllString("must have scheme: http://foo.com/.", -1) // []string{"http://foo.com/"}
+ rxStrict.FindAllString("no scheme, no match: foo.com", -1) // []string{}
}
```
@@ -20,7 +22,9 @@ Note that the funcs compile regexes, so avoid calling them repeatedly.
#### cmd/xurls
- go get -u mvdan.cc/xurls/v2/cmd/xurls
+To install the tool globally:
+
+ go get mvdan.cc/xurls/cmd/xurls
```shell
$ echo "Do gophers live in http://golang.org?" | xurls
diff --git a/vendor/mvdan.cc/xurls/v2/go.mod b/vendor/mvdan.cc/xurls/v2/go.mod
index 6f0822a737..d9d334543c 100644
--- a/vendor/mvdan.cc/xurls/v2/go.mod
+++ b/vendor/mvdan.cc/xurls/v2/go.mod
@@ -1 +1,3 @@
module mvdan.cc/xurls/v2
+
+go 1.13
diff --git a/vendor/mvdan.cc/xurls/v2/schemes.go b/vendor/mvdan.cc/xurls/v2/schemes.go
index 01b7944ae3..e8e6585f47 100644
--- a/vendor/mvdan.cc/xurls/v2/schemes.go
+++ b/vendor/mvdan.cc/xurls/v2/schemes.go
@@ -12,13 +12,18 @@ var Schemes = []string{
`about`,
`acap`,
`acct`,
+ `acd`,
`acr`,
`adiumxtra`,
+ `adt`,
`afp`,
`afs`,
`aim`,
+ `amss`,
+ `android`,
`appdata`,
`apt`,
+ `ark`,
`attachment`,
`aw`,
`barion`,
@@ -28,8 +33,11 @@ var Schemes = []string{
`blob`,
`bolo`,
`browserext`,
+ `calculator`,
`callto`,
`cap`,
+ `cast`,
+ `casts`,
`chrome`,
`chrome-extension`,
`cid`,
@@ -44,6 +52,7 @@ var Schemes = []string{
`conti`,
`crid`,
`cvs`,
+ `dab`,
`data`,
`dav`,
`diaspora`,
@@ -54,6 +63,9 @@ var Schemes = []string{
`dlna-playsingle`,
`dns`,
`dntp`,
+ `dpp`,
+ `drm`,
+ `drop`,
`dtn`,
`dvb`,
`ed2k`,
@@ -66,8 +78,11 @@ var Schemes = []string{
`file`,
`filesystem`,
`finger`,
+ `first-run-pen-experience`,
`fish`,
+ `fm`,
`ftp`,
+ `fuchsia-pkg`,
`geo`,
`gg`,
`git`,
@@ -112,6 +127,8 @@ var Schemes = []string{
`lastfm`,
`ldap`,
`ldaps`,
+ `leaptofrogans`,
+ `lorawan`,
`lvlt`,
`magnet`,
`mailserver`,
@@ -129,9 +146,11 @@ var Schemes = []string{
`moz`,
`ms-access`,
`ms-browser-extension`,
+ `ms-calculator`,
`ms-drive-to`,
`ms-enrollment`,
`ms-excel`,
+ `ms-eyecontrolspeech`,
`ms-gamebarservices`,
`ms-gamingoverlay`,
`ms-getoffice`,
@@ -141,6 +160,7 @@ var Schemes = []string{
`ms-lockscreencomponent-config`,
`ms-media-stream-id`,
`ms-mixedrealitycapture`,
+ `ms-mobileplans`,
`ms-officeapp`,
`ms-people`,
`ms-project`,
@@ -186,6 +206,7 @@ var Schemes = []string{
`msnim`,
`msrp`,
`msrps`,
+ `mss`,
`mtqp`,
`mumble`,
`mupdate`,
@@ -205,6 +226,7 @@ var Schemes = []string{
`pack`,
`palm`,
`paparazzi`,
+ `payto`,
`pkcs11`,
`platform`,
`pop`,
@@ -213,6 +235,7 @@ var Schemes = []string{
`proxy`,
`pwid`,
`psyc`,
+ `pttp`,
`qb`,
`query`,
`redis`,
diff --git a/vendor/mvdan.cc/xurls/v2/tlds.go b/vendor/mvdan.cc/xurls/v2/tlds.go
index 084ab84d46..c98ce508d6 100644
--- a/vendor/mvdan.cc/xurls/v2/tlds.go
+++ b/vendor/mvdan.cc/xurls/v2/tlds.go
@@ -24,7 +24,6 @@ var TLDs = []string{
`accountant`,
`accountants`,
`aco`,
- `active`,
`actor`,
`ad`,
`adac`,
@@ -154,7 +153,6 @@ var TLDs = []string{
`bj`,
`black`,
`blackfriday`,
- `blanco`,
`blockbuster`,
`blog`,
`bloomberg`,
@@ -163,7 +161,6 @@ var TLDs = []string{
`bms`,
`bmw`,
`bn`,
- `bnl`,
`bnpparibas`,
`bo`,
`boats`,
@@ -307,6 +304,7 @@ var TLDs = []string{
`coupon`,
`coupons`,
`courses`,
+ `cpa`,
`cr`,
`credit`,
`creditcard`,
@@ -370,7 +368,6 @@ var TLDs = []string{
`doctor`,
`dodge`,
`dog`,
- `doha`,
`domains`,
`dot`,
`download`,
@@ -379,7 +376,6 @@ var TLDs = []string{
`dubai`,
`duck`,
`dunlop`,
- `duns`,
`dupont`,
`durban`,
`dvag`,
@@ -400,7 +396,6 @@ var TLDs = []string{
`engineer`,
`engineering`,
`enterprises`,
- `epost`,
`epson`,
`equipment`,
`er`,
@@ -496,6 +491,7 @@ var TLDs = []string{
`games`,
`gap`,
`garden`,
+ `gay`,
`gb`,
`gbiz`,
`gd`,
@@ -588,7 +584,6 @@ var TLDs = []string{
`homes`,
`homesense`,
`honda`,
- `honeywell`,
`horse`,
`hospital`,
`host`,
@@ -642,7 +637,6 @@ var TLDs = []string{
`ir`,
`irish`,
`is`,
- `iselect`,
`ismaili`,
`ist`,
`istanbul`,
@@ -752,6 +746,7 @@ var TLDs = []string{
`lixil`,
`lk`,
`llc`,
+ `llp`,
`loan`,
`loans`,
`locker`,
@@ -827,7 +822,6 @@ var TLDs = []string{
`mo`,
`mobi`,
`mobile`,
- `mobily`,
`moda`,
`moe`,
`moi`,
@@ -1161,21 +1155,19 @@ var TLDs = []string{
`sony`,
`soy`,
`space`,
- `spiegel`,
`sport`,
`spot`,
`spreadbetting`,
`sr`,
`srl`,
`srt`,
+ `ss`,
`st`,
`stada`,
`staples`,
`star`,
- `starhub`,
`statebank`,
`statefarm`,
- `statoil`,
`stc`,
`stcgroup`,
`stockholm`,
@@ -1391,7 +1383,6 @@ var TLDs = []string{
`zara`,
`zero`,
`zip`,
- `zippo`,
`zm`,
`zone`,
`zuerich`,
@@ -1449,7 +1440,7 @@ var TLDs = []string{
`كوم`,
`مصر`,
`مليسيا`,
- `موبايلي`,
+ `موريتانيا`,
`موقع`,
`همراه`,
`پاكستان`,
diff --git a/vendor/mvdan.cc/xurls/v2/xurls.go b/vendor/mvdan.cc/xurls/v2/xurls.go
index d6279ae60b..7244c709a0 100644
--- a/vendor/mvdan.cc/xurls/v2/xurls.go
+++ b/vendor/mvdan.cc/xurls/v2/xurls.go
@@ -19,9 +19,9 @@ const (
iriChar = letter + mark + number
currency = `\p{Sc}`
otherSymb = `\p{So}`
- endChar = iriChar + `/\-+_&~*%=#` + currency + otherSymb
+ endChar = iriChar + `/\-+&~%=#` + currency + otherSymb
otherPunc = `\p{Po}`
- midChar = endChar + `|` + otherPunc
+ midChar = endChar + "_*" + otherPunc
wellParen = `\([` + midChar + `]*(\([` + midChar + `]*\)[` + midChar + `]*)*\)`
wellBrack = `\[[` + midChar + `]*(\[[` + midChar + `]*\][` + midChar + `]*)*\]`
wellBrace = `\{[` + midChar + `]*(\{[` + midChar + `]*\}[` + midChar + `]*)*\}`
@@ -72,9 +72,11 @@ func strictExp() string {
}
func relaxedExp() string {
- site := domain + `(?i)` + anyOf(append(TLDs, PseudoTLDs...)...) + `(?-i)`
+ punycode := `xn--[a-z0-9-]+`
+ knownTLDs := anyOf(append(TLDs, PseudoTLDs...)...)
+ site := domain + `(?i)(` + punycode + `|` + knownTLDs + `)(?-i)`
hostName := `(` + site + `|` + ipAddr + `)`
- webURL := hostName + port + `(/|/` + pathCont + `?|\b|$)`
+ webURL := hostName + port + `(/|/` + pathCont + `?|\b|(?m)$)`
return strictExp() + `|` + webURL
}