Skip to content

Commit

Permalink
Vendor: mvdan.cc/xurls v2.1.0 -> v2.2.0 (#13407)
Browse files Browse the repository at this point in the history
  • Loading branch information
6543 authored Nov 3, 2020
1 parent cbdbae2 commit 4ad10ac
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 27 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ require (
gopkg.in/ini.v1 v1.61.0
gopkg.in/ldap.v3 v3.0.2
gopkg.in/yaml.v2 v2.3.0
mvdan.cc/xurls/v2 v2.1.0
mvdan.cc/xurls/v2 v2.2.0
strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251
xorm.io/builder v0.3.7
xorm.io/xorm v1.0.5
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,7 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So
github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.5.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rs/xid v1.2.1 h1:mhH9Nq+C1fY2l1XIpgxIiUOfNpRBYH1kKcr+qfKgjRc=
github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU=
Expand Down Expand Up @@ -1196,8 +1197,7 @@ honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWh
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
mvdan.cc/xurls/v2 v2.1.0 h1:KaMb5GLhlcSX+e+qhbRJODnUUBvlw01jt4yrjFIHAuA=
mvdan.cc/xurls/v2 v2.1.0/go.mod h1:5GrSd9rOnKOpZaji1OZLYL/yeAAtGDlo/cFe+8K5n8E=
mvdan.cc/xurls/v2 v2.2.0/go.mod h1:EV1RMtya9D6G5DMYPGD8zTQzaHet6Jh8gFlRgGRJeO8=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251 h1:mUcz5b3FJbP5Cvdq7Khzn6J9OCUQJaBwgBkCR+MOwSs=
strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251/go.mod h1:FJGmPh3vz9jSos1L/F91iAgnC/aejc0wIIrF2ZwJxdY=
Expand Down
2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,7 @@ gopkg.in/warnings.v0
gopkg.in/yaml.v2
# gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776
gopkg.in/yaml.v3
# mvdan.cc/xurls/v2 v2.1.0
# mvdan.cc/xurls/v2 v2.2.0
## explicit
mvdan.cc/xurls/v2
# strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251
Expand Down
11 changes: 8 additions & 3 deletions vendor/mvdan.cc/xurls/v2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![GoDoc](https://godoc.org/mvdan.cc/xurls?status.svg)](https://godoc.org/mvdan.cc/xurls)

Extract urls from text using regular expressions. Requires Go 1.12 or later.
Extract urls from text using regular expressions. Requires Go 1.13 or later.

```go
import "mvdan.cc/xurls/v2"
Expand All @@ -18,13 +18,18 @@ func main() {
}
```

Note that the funcs compile regexes, so avoid calling them repeatedly.
Since API is centered around [regexp.Regexp](https://golang.org/pkg/regexp/#Regexp),
many other methods are available, such as finding the [byte indexes](https://golang.org/pkg/regexp/#Regexp.FindAllIndex)
for all matches.

Note that calling the exposed functions means compiling a regular expression, so
repeated calls should be avoided.

#### cmd/xurls

To install the tool globally:

go get mvdan.cc/xurls/cmd/xurls
cd $(mktemp -d); go mod init tmp; GO111MODULE=on go get mvdan.cc/xurls/v2/cmd/xurls

```shell
$ echo "Do gophers live in http://golang.org?" | xurls
Expand Down
7 changes: 6 additions & 1 deletion vendor/mvdan.cc/xurls/v2/go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
module mvdan.cc/xurls/v2

go 1.13
go 1.14

require (
github.com/rogpeppe/go-internal v1.5.2
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
)
12 changes: 12 additions & 0 deletions vendor/mvdan.cc/xurls/v2/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/rogpeppe/go-internal v1.5.2 h1:qLvObTrvO/XRCqmkKxUlOBc48bI3efyDuAZe25QiF0w=
github.com/rogpeppe/go-internal v1.5.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/errgo.v2 v2.1.0 h1:0vLT13EuvQ0hNvakwLuFZ/jYrLp5F3kcWHXdRggjCE8=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
3 changes: 3 additions & 0 deletions vendor/mvdan.cc/xurls/v2/schemes.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ var Schemes = []string{
`dpp`,
`drm`,
`drop`,
`dtmi`,
`dtn`,
`dvb`,
`ed2k`,
Expand Down Expand Up @@ -226,6 +227,7 @@ var Schemes = []string{
`pack`,
`palm`,
`paparazzi`,
`payment`,
`payto`,
`pkcs11`,
`platform`,
Expand All @@ -238,6 +240,7 @@ var Schemes = []string{
`pttp`,
`qb`,
`query`,
`quic-transport`,
`redis`,
`rediss`,
`reload`,
Expand Down
22 changes: 5 additions & 17 deletions vendor/mvdan.cc/xurls/v2/tlds.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ var TLDs = []string{
`alsace`,
`alstom`,
`am`,
`amazon`,
`americanexpress`,
`americanfamily`,
`amex`,
Expand Down Expand Up @@ -219,7 +220,6 @@ var TLDs = []string{
`career`,
`careers`,
`cars`,
`cartier`,
`casa`,
`case`,
`caseih`,
Expand Down Expand Up @@ -252,7 +252,6 @@ var TLDs = []string{
`chintai`,
`christmas`,
`chrome`,
`chrysler`,
`church`,
`ci`,
`cipriani`,
Expand Down Expand Up @@ -366,7 +365,6 @@ var TLDs = []string{
`do`,
`docs`,
`doctor`,
`dodge`,
`dog`,
`domains`,
`dot`,
Expand Down Expand Up @@ -411,7 +409,6 @@ var TLDs = []string{
`eurovision`,
`eus`,
`events`,
`everbank`,
`exchange`,
`expert`,
`exposed`,
Expand Down Expand Up @@ -701,12 +698,10 @@ var TLDs = []string{
`kz`,
`la`,
`lacaixa`,
`ladbrokes`,
`lamborghini`,
`lamer`,
`lancaster`,
`lancia`,
`lancome`,
`land`,
`landrover`,
`lanxess`,
Expand All @@ -727,7 +722,6 @@ var TLDs = []string{
`lexus`,
`lgbt`,
`li`,
`liaison`,
`lidl`,
`life`,
`lifeinsurance`,
Expand Down Expand Up @@ -829,15 +823,13 @@ var TLDs = []string{
`monash`,
`money`,
`monster`,
`mopar`,
`mormon`,
`mortgage`,
`moscow`,
`moto`,
`motorcycles`,
`mov`,
`movie`,
`movistar`,
`mp`,
`mq`,
`mr`,
Expand All @@ -856,7 +848,6 @@ var TLDs = []string{
`mz`,
`na`,
`nab`,
`nadex`,
`nagoya`,
`name`,
`nationwide`,
Expand Down Expand Up @@ -958,7 +949,6 @@ var TLDs = []string{
`photography`,
`photos`,
`physio`,
`piaget`,
`pics`,
`pictet`,
`pictures`,
Expand Down Expand Up @@ -1154,13 +1144,13 @@ var TLDs = []string{
`song`,
`sony`,
`soy`,
`spa`,
`space`,
`sport`,
`spot`,
`spreadbetting`,
`sr`,
`srl`,
`srt`,
`ss`,
`st`,
`stada`,
Expand Down Expand Up @@ -1213,7 +1203,6 @@ var TLDs = []string{
`tech`,
`technology`,
`tel`,
`telefonica`,
`temasek`,
`tennis`,
`teva`,
Expand Down Expand Up @@ -1273,7 +1262,6 @@ var TLDs = []string{
`ua`,
`ubank`,
`ubs`,
`uconnect`,
`ug`,
`uk`,
`unicom`,
Expand Down Expand Up @@ -1309,7 +1297,6 @@ var TLDs = []string{
`virgin`,
`visa`,
`vision`,
`vistaprint`,
`viva`,
`vivo`,
`vlaanderen`,
Expand All @@ -1328,7 +1315,6 @@ var TLDs = []string{
`walter`,
`wang`,
`wanggou`,
`warman`,
`watch`,
`watches`,
`weather`,
Expand Down Expand Up @@ -1388,6 +1374,7 @@ var TLDs = []string{
`zuerich`,
`zw`,
`ελ`,
`ευ`,
`бг`,
`бел`,
`дети`,
Expand Down Expand Up @@ -1469,6 +1456,7 @@ var TLDs = []string{
`ไทย`,
`გე`,
`みんな`,
`アマゾン`,
`クラウド`,
`グーグル`,
`コム`,
Expand All @@ -1481,6 +1469,7 @@ var TLDs = []string{
`中国`,
`中國`,
`中文网`,
`亚马逊`,
`企业`,
`佛山`,
`信息`,
Expand All @@ -1501,7 +1490,6 @@ var TLDs = []string{
`天主教`,
`娱乐`,
`家電`,
`工行`,
`广东`,
`微博`,
`慈善`,
Expand Down
4 changes: 2 additions & 2 deletions vendor/mvdan.cc/xurls/v2/xurls.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ 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
wellParen = `\([` + midChar + `]*(\([` + midChar + `]*\)[` + midChar + `]*)*\)`
Expand Down Expand Up @@ -76,7 +76,7 @@ func relaxedExp() string {
knownTLDs := anyOf(append(TLDs, PseudoTLDs...)...)
site := domain + `(?i)(` + punycode + `|` + knownTLDs + `)(?-i)`
hostName := `(` + site + `|` + ipAddr + `)`
webURL := hostName + port + `(/|/` + pathCont + `?|\b|(?m)$)`
webURL := hostName + port + `(/|/` + pathCont + `)?`
return strictExp() + `|` + webURL
}

Expand Down

0 comments on commit 4ad10ac

Please sign in to comment.