From 7ca6cd5c2893256c58e21ae72cc8d4b2a154cf80 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 31 Aug 2026 22:04:30 +0000 Subject: [PATCH] Bump github.com/PuerkitoBio/goquery in /src/notifications Bumps [github.com/PuerkitoBio/goquery](https://github.com/PuerkitoBio/goquery) from 1.12.0 to 1.13.0. - [Release notes](https://github.com/PuerkitoBio/goquery/releases) - [Commits](https://github.com/PuerkitoBio/goquery/compare/v1.12.0...v1.13.0) --- updated-dependencies: - dependency-name: github.com/PuerkitoBio/goquery dependency-version: 1.13.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- src/notifications/go.mod | 16 +- src/notifications/go.sum | 88 +-- .../github.com/PuerkitoBio/goquery/README.md | 3 + .../github.com/PuerkitoBio/goquery/array.go | 8 +- .../github.com/PuerkitoBio/goquery/filter.go | 77 +- .../PuerkitoBio/goquery/manipulation.go | 77 +- .../PuerkitoBio/goquery/property.go | 89 ++- .../github.com/PuerkitoBio/goquery/query.go | 27 +- .../PuerkitoBio/goquery/traversal.go | 62 +- .../github.com/PuerkitoBio/goquery/type.go | 23 +- .../PuerkitoBio/goquery/utilities.go | 68 +- .../andybalholm/cascadia/pseudo_classes.go | 6 +- .../vendor/golang.org/x/net/html/entity.go | 5 +- .../vendor/golang.org/x/net/html/escape.go | 140 ++-- .../vendor/golang.org/x/net/html/foreign.go | 2 +- .../vendor/golang.org/x/net/html/parse.go | 249 ++----- .../vendor/golang.org/x/net/html/token.go | 41 +- .../golang.org/x/sync/errgroup/errgroup.go | 2 +- .../golang.org/x/sys/unix/syscall_linux.go | 1 + .../x/sys/unix/syscall_linux_386.go | 1 - .../x/sys/unix/syscall_linux_amd64.go | 1 - .../x/sys/unix/syscall_linux_arm.go | 1 - .../x/sys/unix/syscall_linux_arm64.go | 1 - .../x/sys/unix/syscall_linux_loong64.go | 1 - .../x/sys/unix/syscall_linux_mips64x.go | 1 - .../x/sys/unix/syscall_linux_mipsx.go | 1 - .../x/sys/unix/syscall_linux_ppc.go | 1 - .../x/sys/unix/syscall_linux_ppc64x.go | 1 - .../x/sys/unix/syscall_linux_riscv64.go | 1 - .../x/sys/unix/syscall_linux_s390x.go | 1 - .../x/sys/unix/syscall_linux_sparc64.go | 1 - .../golang.org/x/sys/unix/zerrors_linux.go | 8 +- .../golang.org/x/sys/unix/zsyscall_linux.go | 17 + .../x/sys/unix/zsyscall_linux_386.go | 17 - .../x/sys/unix/zsyscall_linux_amd64.go | 17 - .../x/sys/unix/zsyscall_linux_arm.go | 17 - .../x/sys/unix/zsyscall_linux_arm64.go | 17 - .../x/sys/unix/zsyscall_linux_loong64.go | 17 - .../x/sys/unix/zsyscall_linux_mips.go | 17 - .../x/sys/unix/zsyscall_linux_mips64.go | 17 - .../x/sys/unix/zsyscall_linux_mips64le.go | 17 - .../x/sys/unix/zsyscall_linux_mipsle.go | 17 - .../x/sys/unix/zsyscall_linux_ppc.go | 17 - .../x/sys/unix/zsyscall_linux_ppc64.go | 17 - .../x/sys/unix/zsyscall_linux_ppc64le.go | 17 - .../x/sys/unix/zsyscall_linux_riscv64.go | 17 - .../x/sys/unix/zsyscall_linux_s390x.go | 17 - .../x/sys/unix/zsyscall_linux_sparc64.go | 17 - .../golang.org/x/sys/unix/ztypes_linux.go | 76 ++ .../golang.org/x/sys/unix/ztypes_linux_386.go | 4 + .../x/sys/unix/ztypes_linux_amd64.go | 4 + .../golang.org/x/sys/unix/ztypes_linux_arm.go | 4 + .../x/sys/unix/ztypes_linux_arm64.go | 4 + .../x/sys/unix/ztypes_linux_loong64.go | 4 + .../x/sys/unix/ztypes_linux_mips.go | 4 + .../x/sys/unix/ztypes_linux_mips64.go | 4 + .../x/sys/unix/ztypes_linux_mips64le.go | 4 + .../x/sys/unix/ztypes_linux_mipsle.go | 4 + .../golang.org/x/sys/unix/ztypes_linux_ppc.go | 4 + .../x/sys/unix/ztypes_linux_ppc64.go | 4 + .../x/sys/unix/ztypes_linux_ppc64le.go | 4 + .../x/sys/unix/ztypes_linux_riscv64.go | 4 + .../x/sys/unix/ztypes_linux_s390x.go | 4 + .../x/sys/unix/ztypes_linux_sparc64.go | 4 + .../golang.org/x/tools/go/ast/edge/edge.go | 24 +- .../golang.org/x/tools/go/packages/golist.go | 17 +- .../x/tools/go/packages/packages.go | 30 +- .../x/tools/go/types/objectpath/objectpath.go | 570 +++++++++------ .../x/tools/internal/gcimporter/iexport.go | 3 + .../x/tools/internal/gcimporter/iimport.go | 26 +- .../x/tools/internal/gcimporter/ureader.go | 42 +- .../x/tools/internal/gocommand/version.go | 5 +- .../x/tools/internal/stdlib/deps.go | 655 +++++++++--------- .../x/tools/internal/stdlib/manifest.go | 289 +++++++- .../x/tools/internal/typesinternal/element.go | 8 +- .../x/tools/internal/typesinternal/types.go | 28 + .../tools/internal/typesinternal/zerovalue.go | 16 +- src/notifications/vendor/modules.txt | 18 +- 78 files changed, 1812 insertions(+), 1331 deletions(-) diff --git a/src/notifications/go.mod b/src/notifications/go.mod index 9717ef8b..e42c180c 100644 --- a/src/notifications/go.mod +++ b/src/notifications/go.mod @@ -4,7 +4,7 @@ go 1.26.4 require ( github.com/DATA-DOG/go-sqlmock v1.5.2 - github.com/PuerkitoBio/goquery v1.12.0 + github.com/PuerkitoBio/goquery v1.13.0 github.com/chrj/smtpd v1.0.0 github.com/cloudfoundry-community/go-uaa v0.3.6 github.com/go-sql-driver/mysql v1.10.0 @@ -28,7 +28,7 @@ require ( code.cloudfoundry.org/lager v2.0.0+incompatible // indirect filippo.io/edwards25519 v1.2.0 // indirect github.com/Masterminds/semver/v3 v3.4.0 // indirect - github.com/andybalholm/cascadia v1.3.3 // indirect + github.com/andybalholm/cascadia v1.3.4 // indirect github.com/dgrijalva/jwt-go v3.2.1-0.20210802184156-9742bd7fca1c+incompatible // indirect github.com/fsnotify/fsnotify v1.5.1 // indirect github.com/go-gorp/gorp/v3 v3.1.0 // indirect @@ -42,12 +42,12 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/ziutek/mymysql v1.5.4 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect - golang.org/x/mod v0.35.0 // indirect - golang.org/x/net v0.55.0 // indirect + golang.org/x/mod v0.38.0 // indirect + golang.org/x/net v0.58.0 // indirect golang.org/x/oauth2 v0.34.0 // indirect - golang.org/x/sync v0.20.0 // indirect - golang.org/x/sys v0.45.0 // indirect - golang.org/x/text v0.37.0 // indirect - golang.org/x/tools v0.44.0 // indirect + golang.org/x/sync v0.22.0 // indirect + golang.org/x/sys v0.47.0 // indirect + golang.org/x/text v0.41.0 // indirect + golang.org/x/tools v0.48.0 // indirect gopkg.in/alexcesaro/quotedprintable.v1 v1.0.0-20141111223934-dacd4576c5aa // indirect ) diff --git a/src/notifications/go.sum b/src/notifications/go.sum index d3641b07..7efe8895 100644 --- a/src/notifications/go.sum +++ b/src/notifications/go.sum @@ -6,10 +6,10 @@ github.com/DATA-DOG/go-sqlmock v1.5.2 h1:OcvFkGmslmlZibjAjaHm3L//6LiuBgolP7Oputl github.com/DATA-DOG/go-sqlmock v1.5.2/go.mod h1:88MAG/4G7SMwSE3CeA0ZKzrT5CiOU3OJ+JlNzwDqpNU= github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0= github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= -github.com/PuerkitoBio/goquery v1.12.0 h1:pAcL4g3WRXekcB9AU/y1mbKez2dbY2AajVhtkO8RIBo= -github.com/PuerkitoBio/goquery v1.12.0/go.mod h1:802ej+gV2y7bbIhOIoPY5sT183ZW0YFofScC4q/hIpQ= -github.com/andybalholm/cascadia v1.3.3 h1:AG2YHrzJIm4BZ19iwJ/DAua6Btl3IwJX+VI4kktS1LM= -github.com/andybalholm/cascadia v1.3.3/go.mod h1:xNd9bqTn98Ln4DwST8/nG+H0yuB8Hmgu1YHNnWw0GeA= +github.com/PuerkitoBio/goquery v1.13.0 h1:mqHbjD7Jmnul4DTR24LKTjo1uUmHUh072kteGV+xpFM= +github.com/PuerkitoBio/goquery v1.13.0/go.mod h1:Hip5mdBL8K2wEGKJdr27sRaNwIdDajmCwB/ExUPwW+g= +github.com/andybalholm/cascadia v1.3.4 h1:vM2lgh0Vru9Vwyfm4cQqWP2HHMW0u0+2PAW7Q38Qufg= +github.com/andybalholm/cascadia v1.3.4/go.mod h1:BLRmbRjpEtNKieZOCCvYj4RqN+KRA41GBe/5O+G93kM= github.com/chrj/smtpd v1.0.0 h1:jChSfLzAhrSxTky0EZ6oW+UKiqdnepdknWYRkPeA+ZE= github.com/chrj/smtpd v1.0.0/go.mod h1:zEP61gNDlWp/jdUqBcq/ykIbgOERyRvwfMsRLl3h9gM= github.com/cloudfoundry-community/go-uaa v0.3.6 h1:G4yWO3Axi5eTOvqfWBBSWiA1Mkonlk/q2DxGXIYtbGE= @@ -52,7 +52,6 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/pprof v0.0.0-20260402051712-545e8a4df936 h1:EwtI+Al+DeppwYX2oXJCETMO23COyaKGP6fHVpkpWpg= @@ -129,7 +128,6 @@ github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhso github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY= github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/ziutek/mymysql v1.5.4 h1:GB0qdRGsTwQSBVYuVShFBKaXSnSnYYC2d9knnE1LHFs= github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0= go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= @@ -137,47 +135,23 @@ go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= -golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= -golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/mod v0.35.0 h1:Ww1D637e6Pg+Zb2KrWfHQUnH2dQRLBQyAtpr/haaJeM= -golang.org/x/mod v0.35.0/go.mod h1:+GwiRhIInF8wPm+4AoT6L0FA1QWAad3OMdTRx4tFYlU= +golang.org/x/mod v0.38.0 h1:MECBjubtXD7yj4HrhIUcywNaGeNVUdfVnxmPajOk4yk= +golang.org/x/mod v0.38.0/go.mod h1:V6Xz0pq8TQ3dGqVQ1FVHuelZpAL0uNhSkk9ogYP3c40= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= -golang.org/x/net v0.55.0 h1:bcvxaJn3e1U6InsFWt1JUq1aSjnRxLzT2rtD2KfkDF8= -golang.org/x/net v0.55.0/go.mod h1:L5U2KuzuOe1lY7Z+aWVIKK6qEeJXnXV9yzGA+WCHJww= +golang.org/x/net v0.58.0 h1:ynWG7rqYi4ccpTEuPZ2QGWHktVEM9DMCj9yzDE0Q7To= +golang.org/x/net v0.58.0/go.mod h1:YwCddHnFlT7eLQqVprV19OnhLGtc5xOKgE0RyqgfWAU= golang.org/x/oauth2 v0.34.0 h1:hqK/t4AKgbqWkdkcAeI8XLmbK+4m4G5YeQRrmiotGlw= golang.org/x/oauth2 v0.34.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= -golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= +golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek= +golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -186,49 +160,19 @@ golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY= -golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= -golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= -golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= -golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= -golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= +golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs= +golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= -golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc= -golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38= +golang.org/x/text v0.41.0 h1:vz/seA0lnX87Othu2f/0L24RcgrXD9/YFTSuGjj3rH8= +golang.org/x/text v0.41.0/go.mod h1:jvf1O8ajNzZqhSrQBPbutR/EB83Cc0CFrezNQIwbb5M= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= -golang.org/x/tools v0.44.0 h1:UP4ajHPIcuMjT1GqzDWRlalUEoY+uzoZKnhOjbIPD2c= -golang.org/x/tools v0.44.0/go.mod h1:KA0AfVErSdxRZIsOVipbv3rQhVXTnlU6UhKxHd1seDI= +golang.org/x/tools v0.48.0 h1:3+hClM1aLL5mjMKm5ovokw9epgRXPuu2tILgismM6RE= +golang.org/x/tools v0.48.0/go.mod h1:08xX0orndb/F7jJxGDicx061tyd5pcMto75YMAXr6lk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/src/notifications/vendor/github.com/PuerkitoBio/goquery/README.md b/src/notifications/vendor/github.com/PuerkitoBio/goquery/README.md index 395314a0..446ba991 100644 --- a/src/notifications/vendor/github.com/PuerkitoBio/goquery/README.md +++ b/src/notifications/vendor/github.com/PuerkitoBio/goquery/README.md @@ -48,6 +48,7 @@ Ongoing goquery development is tested on the latest 2 versions of Go. **Note that goquery's API is now stable, and will not break.** +* **2026-08-27 (v1.13.0)** : Performance improvements (thanks [@jvoisin][jvs]), add top-level `Text` function with options similar to BeautifulSoup's `get_text` (thanks [@ChrisJr404][chrisjr]), update `go.mod` dependencies, add go1.27 to the test matrix. * **2026-03-15 (v1.12.0)** : Update `go.mod` dependencies, add go1.26 to the test matrix, **goquery now requires Go version 1.25+**. * **2025-11-16 (v1.11.0)** : Update `go.mod` dependencies, add go1.25 to the test matrix, **goquery now requires Go version 1.24+**. * **2025-04-11 (v1.10.3)** : Update `go.mod` dependencies, small optimization (thanks [@myxzlpltk](https://github.com/myxzlpltk)). @@ -216,3 +217,5 @@ The [BSD 3-Clause license][bsd], the same as the [Go language][golic]. Cascadia' [goq]: https://github.com/andrewstuart/goq [thiemok]: https://github.com/thiemok [djw]: https://github.com/davidjwilkins +[jvs]: https://github.com/jvoisin +[chrisjr]: https://github.com/ChrisJr404 diff --git a/src/notifications/vendor/github.com/PuerkitoBio/goquery/array.go b/src/notifications/vendor/github.com/PuerkitoBio/goquery/array.go index 1b1f6cbe..f75be617 100644 --- a/src/notifications/vendor/github.com/PuerkitoBio/goquery/array.go +++ b/src/notifications/vendor/github.com/PuerkitoBio/goquery/array.go @@ -81,7 +81,13 @@ func (s *Selection) Get(index int) *html.Node { // relative to its sibling elements. func (s *Selection) Index() int { if len(s.Nodes) > 0 { - return newSingleSelection(s.Nodes[0], s.document).PrevAll().Length() + i := 0 + for n := s.Nodes[0].PrevSibling; n != nil; n = n.PrevSibling { + if n.Type == html.ElementNode { + i++ + } + } + return i } return -1 } diff --git a/src/notifications/vendor/github.com/PuerkitoBio/goquery/filter.go b/src/notifications/vendor/github.com/PuerkitoBio/goquery/filter.go index 9138ffb3..2964b8a4 100644 --- a/src/notifications/vendor/github.com/PuerkitoBio/goquery/filter.go +++ b/src/notifications/vendor/github.com/PuerkitoBio/goquery/filter.go @@ -12,7 +12,7 @@ func (s *Selection) Filter(selector string) *Selection { // the given matcher. It returns a new Selection object for this subset // of matching elements. func (s *Selection) FilterMatcher(m Matcher) *Selection { - return pushStack(s, winnow(s, m, true)) + return pushStack(s, winnow(s.Nodes, m, true)) } // Not removes elements from the Selection that match the selector string. @@ -24,7 +24,7 @@ func (s *Selection) Not(selector string) *Selection { // NotMatcher removes elements from the Selection that match the given matcher. // It returns a new Selection object with the matching elements removed. func (s *Selection) NotMatcher(m Matcher) *Selection { - return pushStack(s, winnow(s, m, false)) + return pushStack(s, winnow(s.Nodes, m, false)) } // FilterFunction reduces the set of matched elements to those that pass the function's test. @@ -79,29 +79,46 @@ func (s *Selection) Intersection(sel *Selection) *Selection { // that matches the selector. // It returns a new Selection object with the matching elements. func (s *Selection) Has(selector string) *Selection { - return s.HasSelection(s.document.Find(selector)) + return s.HasMatcher(compileMatcher(selector)) } // HasMatcher reduces the set of matched elements to those that have a descendant // that matches the matcher. // It returns a new Selection object with the matching elements. func (s *Selection) HasMatcher(m Matcher) *Selection { - return s.HasSelection(s.document.FindMatcher(m)) + result := make([]*html.Node, 0, len(s.Nodes)) + + // Manually create a singleMatcher (rather than using SingleMatcher, which + // returns a Matcher interface) so we can call its MatchFirst method + // directly. MatchFirst probes for the first match in a subtree without + // building a result slice, avoiding a throwaway one-element slice + // allocation for every matching child subtree. + sm := singleMatcher{m} + for _, n := range s.Nodes { + for c := n.FirstChild; c != nil; c = c.NextSibling { + if c.Type == html.ElementNode && sm.MatchFirst(c) != nil { + result = append(result, n) + break + } + } + } + return pushStack(s, result) } // HasNodes reduces the set of matched elements to those that have a // descendant that matches one of the nodes. // It returns a new Selection object with the matching elements. func (s *Selection) HasNodes(nodes ...*html.Node) *Selection { - return s.FilterFunction(func(_ int, sel *Selection) bool { - // Add all nodes that contain one of the specified nodes - for _, n := range nodes { - if sel.Contains(n) { - return true + var result []*html.Node + for _, n := range s.Nodes { + for _, candidate := range nodes { + if nodeContains(n, candidate) { + result = append(result, n) + break } } - return false - }) + } + return pushStack(s, result) } // HasSelection reduces the set of matched elements to those that have a @@ -125,33 +142,45 @@ func (s *Selection) End() *Selection { // Filter based on the matcher, and the indicator to keep (Filter) or // to get rid of (Not) the matching elements. -func winnow(sel *Selection, m Matcher, keep bool) []*html.Node { +func winnow(nodes []*html.Node, m Matcher, keep bool) []*html.Node { // Optimize if keep is requested if keep { - return m.Filter(sel.Nodes) + return m.Filter(nodes) } - // Use grep - return grep(sel, func(i int, s *Selection) bool { - return !m.Match(s.Get(0)) - }) + // Not path: call Match directly on each node, no Selection wrapper needed + result := make([]*html.Node, 0, len(nodes)) + for _, n := range nodes { + if !m.Match(n) { + result = append(result, n) + } + } + return result } // Filter based on an array of nodes, and the indicator to keep (Filter) or // to get rid of (Not) the matching elements. func winnowNodes(sel *Selection, nodes []*html.Node, keep bool) []*html.Node { if len(nodes)+len(sel.Nodes) < minNodesForSet { - return grep(sel, func(i int, s *Selection) bool { - return isInSlice(nodes, s.Get(0)) == keep - }) + var result []*html.Node + for _, n := range sel.Nodes { + if isInSlice(nodes, n) == keep { + result = append(result, n) + } + } + return result } - set := make(map[*html.Node]bool) + set := make(map[*html.Node]bool, len(nodes)) for _, n := range nodes { set[n] = true } - return grep(sel, func(i int, s *Selection) bool { - return set[s.Get(0)] == keep - }) + var result []*html.Node + for _, n := range sel.Nodes { + if set[n] == keep { + result = append(result, n) + } + } + return result } // Filter based on a function test, and the indicator to keep (Filter) or diff --git a/src/notifications/vendor/github.com/PuerkitoBio/goquery/manipulation.go b/src/notifications/vendor/github.com/PuerkitoBio/goquery/manipulation.go index 35febf11..202b02df 100644 --- a/src/notifications/vendor/github.com/PuerkitoBio/goquery/manipulation.go +++ b/src/notifications/vendor/github.com/PuerkitoBio/goquery/manipulation.go @@ -166,8 +166,16 @@ func (s *Selection) Clone() *Selection { // Empty removes all children nodes from the set of matched elements. // It returns the children nodes in a new Selection. func (s *Selection) Empty() *Selection { - var nodes []*html.Node + // Count the children first so nodes can be presized, avoiding append's + // repeated reallocations. + count := 0 + for _, n := range s.Nodes { + for c := n.FirstChild; c != nil; c = c.NextSibling { + count++ + } + } + nodes := make([]*html.Node, 0, count) for _, n := range s.Nodes { for c := n.FirstChild; c != nil; c = n.FirstChild { n.RemoveChild(c) @@ -374,20 +382,14 @@ func (s *Selection) WrapSelection(sel *Selection) *Selection { // // It returns the original set of elements. func (s *Selection) WrapHtml(htmlStr string) *Selection { - nodesMap := make(map[string][]*html.Node) - for _, context := range s.Nodes { - var parent *html.Node - if context.Parent != nil { - parent = context.Parent - } else { + cache := make(map[string][]*html.Node) + for _, n := range s.Nodes { + parent := n.Parent + if parent == nil { parent = &html.Node{Type: html.ElementNode} } - nodes, found := nodesMap[nodeName(parent)] - if !found { - nodes = parseHtmlWithContext(htmlStr, parent) - nodesMap[nodeName(parent)] = nodes - } - newSingleSelection(context, s.document).wrapAllNodes(cloneNodes(nodes)...) + nodes := cachedParseHtmlWithContext(cache, htmlStr, parent) + newSingleSelection(n, s.document).wrapAllNodes(cloneNodes(nodes)...) } return s } @@ -522,14 +524,10 @@ func (s *Selection) WrapInnerSelection(sel *Selection) *Selection { // // It returns the original set of elements. func (s *Selection) WrapInnerHtml(htmlStr string) *Selection { - nodesMap := make(map[string][]*html.Node) - for _, context := range s.Nodes { - nodes, found := nodesMap[nodeName(context)] - if !found { - nodes = parseHtmlWithContext(htmlStr, context) - nodesMap[nodeName(context)] = nodes - } - newSingleSelection(context, s.document).wrapInnerNodes(cloneNodes(nodes)...) + cache := make(map[string][]*html.Node) + for _, n := range s.Nodes { + nodes := cachedParseHtmlWithContext(cache, htmlStr, n) + newSingleSelection(n, s.document).wrapInnerNodes(cloneNodes(nodes)...) } return s } @@ -562,13 +560,7 @@ func (s *Selection) wrapInnerNodes(ns ...*html.Node) *Selection { } func parseHtml(h string) []*html.Node { - // Errors are only returned when the io.Reader returns any error besides - // EOF, but strings.Reader never will - nodes, err := html.ParseFragment(strings.NewReader(h), &html.Node{Type: html.ElementNode}) - if err != nil { - panic("goquery: failed to parse HTML: " + err.Error()) - } - return nodes + return parseHtmlWithContext(h, &html.Node{Type: html.ElementNode}) } func parseHtmlWithContext(h string, context *html.Node) []*html.Node { @@ -654,10 +646,9 @@ func (s *Selection) manipulateNodes(ns []*html.Node, reverse bool, // isParent can be used to indicate that the elements of the selection should be treated as the parent for the parsed html. // A cache is used to avoid parsing the html multiple times should the elements of the selection result in the same context. func (s *Selection) eachNodeHtml(htmlStr string, isParent bool, mergeFn func(n *html.Node, nodes []*html.Node)) *Selection { - // cache to avoid parsing the html for the same context multiple times - nodeCache := make(map[string][]*html.Node) - var context *html.Node + cache := make(map[string][]*html.Node) for _, n := range s.Nodes { + var context *html.Node if isParent { context = n.Parent } else { @@ -666,14 +657,24 @@ func (s *Selection) eachNodeHtml(htmlStr string, isParent bool, mergeFn func(n * } context = n } - if context != nil { - nodes, found := nodeCache[nodeName(context)] - if !found { - nodes = parseHtmlWithContext(htmlStr, context) - nodeCache[nodeName(context)] = nodes - } - mergeFn(n, cloneNodes(nodes)) + if context == nil { + continue } + nodes := cachedParseHtmlWithContext(cache, htmlStr, context) + mergeFn(n, cloneNodes(nodes)) } return s } + +// cachedParseHtmlWithContext returns parseHtmlWithContext(htmlStr, context), reusing a prior +// result when context's nodeName has already been seen. Callers pass their own +// cache map so the cache lifetime matches the caller's loop scope. +func cachedParseHtmlWithContext(cache map[string][]*html.Node, htmlStr string, context *html.Node) []*html.Node { + key := nodeName(context) + if nodes, ok := cache[key]; ok { + return nodes + } + nodes := parseHtmlWithContext(htmlStr, context) + cache[key] = nodes + return nodes +} diff --git a/src/notifications/vendor/github.com/PuerkitoBio/goquery/property.go b/src/notifications/vendor/github.com/PuerkitoBio/goquery/property.go index 25afceda..bda736a2 100644 --- a/src/notifications/vendor/github.com/PuerkitoBio/goquery/property.go +++ b/src/notifications/vendor/github.com/PuerkitoBio/goquery/property.go @@ -1,36 +1,31 @@ package goquery import ( - "regexp" "strings" "golang.org/x/net/html" ) -var rxClassTrim = regexp.MustCompile("[\t\r\n]") +var classTrimReplacer = strings.NewReplacer("\t", " ", "\r", " ", "\n", " ") // Attr gets the specified attribute's value for the first element in the // Selection. To get the value for each element individually, use a looping // construct such as Each or Map method. -func (s *Selection) Attr(attrName string) (val string, exists bool) { - if len(s.Nodes) == 0 { - return +func (s *Selection) Attr(attrName string) (string, bool) { + if len(s.Nodes) != 0 { + if attr := getAttributePtr(attrName, s.Nodes[0]); attr != nil { + return attr.Val, true + } } - return getAttributeValue(attrName, s.Nodes[0]) + return "", false } // AttrOr works like Attr but returns default value if attribute is not present. func (s *Selection) AttrOr(attrName, defaultValue string) string { - if len(s.Nodes) == 0 { - return defaultValue - } - - val, exists := getAttributeValue(attrName, s.Nodes[0]) - if !exists { - return defaultValue + if val, exists := s.Attr(attrName); exists { + return val } - - return val + return defaultValue } // RemoveAttr removes the named attribute from each element in the set of matched elements. @@ -60,27 +55,23 @@ func (s *Selection) SetAttr(attrName, val string) *Selection { // elements, including their descendants. func (s *Selection) Text() string { var builder strings.Builder - - // Slightly optimized vs calling Each: no single selection object created - var f func(*html.Node) - f = func(n *html.Node) { - if n.Type == html.TextNode { - // Keep newlines and spaces, like jQuery - builder.WriteString(n.Data) - } - if n.FirstChild != nil { - for c := n.FirstChild; c != nil; c = c.NextSibling { - f(c) - } - } - } for _, n := range s.Nodes { - f(n) + s.textHelper(n, &builder) } return builder.String() } +func (s *Selection) textHelper(n *html.Node, builder *strings.Builder) { + if n.Type == html.TextNode { + // Keep newlines and spaces, like jQuery + builder.WriteString(n.Data) + } + for c := n.FirstChild; c != nil; c = c.NextSibling { + s.textHelper(c, builder) + } +} + // Size is an alias for Length. func (s *Selection) Size() int { return s.Length() @@ -122,7 +113,7 @@ func (s *Selection) AddClass(class ...string) *Selection { tcls := getClassesSlice(classStr) for _, n := range s.Nodes { - curClasses, attr := getClassesAndAttr(n, true) + curClasses, attr := getClassesAndAttr(n) for _, newClass := range tcls { if !strings.Contains(curClasses, " "+newClass+" ") { curClasses += newClass + " " @@ -138,11 +129,20 @@ func (s *Selection) AddClass(class ...string) *Selection { // HasClass determines whether any of the matched elements are assigned the // given class. func (s *Selection) HasClass(class string) bool { + rawClass := class class = " " + class + " " for _, n := range s.Nodes { - classes, _ := getClassesAndAttr(n, false) - if strings.Contains(classes, class) { - return true + if n.Type != html.ElementNode { + continue + } + if attr := getAttributePtr("class", n); attr != nil { + if !strings.Contains(attr.Val, rawClass) { + continue + } + val := classTrimReplacer.Replace(attr.Val) + if strings.Contains(" "+val+" ", class) { + return true + } } } return false @@ -165,7 +165,7 @@ func (s *Selection) RemoveClass(class ...string) *Selection { if remove { removeAttr(n, "class") } else { - classes, attr := getClassesAndAttr(n, true) + classes, attr := getClassesAndAttr(n) for _, rcl := range rclasses { classes = strings.ReplaceAll(classes, " "+rcl+" ", " ") } @@ -189,7 +189,7 @@ func (s *Selection) ToggleClass(class ...string) *Selection { tcls := getClassesSlice(classStr) for _, n := range s.Nodes { - classes, attr := getClassesAndAttr(n, true) + classes, attr := getClassesAndAttr(n) for _, tcl := range tcls { spaceAroundTcl := " " + tcl + " " if strings.Contains(classes, spaceAroundTcl) { @@ -218,21 +218,12 @@ func getAttributePtr(attrName string, n *html.Node) *html.Attribute { return nil } -// Private function to get the specified attribute's value from a node. -func getAttributeValue(attrName string, n *html.Node) (val string, exists bool) { - if a := getAttributePtr(attrName, n); a != nil { - val = a.Val - exists = true - } - return -} - // Get and normalize the "class" attribute from the node. -func getClassesAndAttr(n *html.Node, create bool) (classes string, attr *html.Attribute) { +func getClassesAndAttr(n *html.Node) (classes string, attr *html.Attribute) { // Applies only to element nodes if n.Type == html.ElementNode { attr = getAttributePtr("class", n) - if attr == nil && create { + if attr == nil { n.Attr = append(n.Attr, html.Attribute{ Key: "class", Val: "", @@ -244,14 +235,14 @@ func getClassesAndAttr(n *html.Node, create bool) (classes string, attr *html.At if attr == nil { classes = " " } else { - classes = rxClassTrim.ReplaceAllString(" "+attr.Val+" ", " ") + classes = classTrimReplacer.Replace(" " + attr.Val + " ") } return } func getClassesSlice(classes string) []string { - return strings.Split(rxClassTrim.ReplaceAllString(" "+classes+" ", " "), " ") + return strings.Fields(classes) } func removeAttr(n *html.Node, attrName string) { diff --git a/src/notifications/vendor/github.com/PuerkitoBio/goquery/query.go b/src/notifications/vendor/github.com/PuerkitoBio/goquery/query.go index fe86bf0b..322b2f8b 100644 --- a/src/notifications/vendor/github.com/PuerkitoBio/goquery/query.go +++ b/src/notifications/vendor/github.com/PuerkitoBio/goquery/query.go @@ -11,32 +11,43 @@ func (s *Selection) Is(selector string) bool { // IsMatcher checks the current matched set of elements against a matcher and // returns true if at least one of these elements matches. func (s *Selection) IsMatcher(m Matcher) bool { - if len(s.Nodes) > 0 { - if len(s.Nodes) == 1 { - return m.Match(s.Nodes[0]) + for _, n := range s.Nodes { + if m.Match(n) { + return true } - return len(m.Filter(s.Nodes)) > 0 } - return false } // IsFunction checks the current matched set of elements against a predicate and // returns true if at least one of these elements matches. func (s *Selection) IsFunction(f func(int, *Selection) bool) bool { - return s.FilterFunction(f).Length() > 0 + for i, n := range s.Nodes { + if f(i, newSingleSelection(n, s.document)) { + return true + } + } + return false } // IsSelection checks the current matched set of elements against a Selection object // and returns true if at least one of these elements matches. func (s *Selection) IsSelection(sel *Selection) bool { - return s.FilterSelection(sel).Length() > 0 + if sel == nil { + return false + } + return s.IsNodes(sel.Nodes...) } // IsNodes checks the current matched set of elements against the specified nodes // and returns true if at least one of these elements matches. func (s *Selection) IsNodes(nodes ...*html.Node) bool { - return s.FilterNodes(nodes...).Length() > 0 + for _, n := range s.Nodes { + if isInSlice(nodes, n) { + return true + } + } + return false } // Contains returns true if the specified Node is within, diff --git a/src/notifications/vendor/github.com/PuerkitoBio/goquery/traversal.go b/src/notifications/vendor/github.com/PuerkitoBio/goquery/traversal.go index c45fa5db..da411403 100644 --- a/src/notifications/vendor/github.com/PuerkitoBio/goquery/traversal.go +++ b/src/notifications/vendor/github.com/PuerkitoBio/goquery/traversal.go @@ -149,7 +149,7 @@ func (s *Selection) ClosestMatcher(m Matcher) *Selection { // ClosestNodes gets the first element that matches one of the nodes by testing the // element itself and traversing up through its ancestors in the DOM tree. func (s *Selection) ClosestNodes(nodes ...*html.Node) *Selection { - set := make(map[*html.Node]bool) + set := make(map[*html.Node]bool, len(nodes)) for _, n := range nodes { set[n] = true } @@ -537,10 +537,7 @@ func (s *Selection) PrevMatcherUntilNodes(filter Matcher, nodes ...*html.Node) * // Filter and push filters the nodes based on a matcher, and pushes the results // on the stack, with the srcSel as previous selection. func filterAndPush(srcSel *Selection, nodes []*html.Node, m Matcher) *Selection { - // Create a temporary Selection with the specified nodes to filter using winnow - sel := &Selection{nodes, srcSel.document, nil} - // Filter based on matcher and push on stack - return pushStack(srcSel, winnow(sel, m, true)) + return pushStack(srcSel, winnow(nodes, m, true)) } // Internal implementation of Find that return raw nodes. @@ -562,13 +559,12 @@ func findWithMatcher(nodes []*html.Node, m Matcher) []*html.Node { func getParentsNodes(nodes []*html.Node, stopm Matcher, stopNodes []*html.Node) []*html.Node { return mapNodes(nodes, func(i int, n *html.Node) (result []*html.Node) { for p := n.Parent; p != nil; p = p.Parent { - sel := newSingleSelection(p, nil) if stopm != nil { - if sel.IsMatcher(stopm) { + if stopm.Match(p) { break } } else if len(stopNodes) > 0 { - if sel.IsNodes(stopNodes...) { + if isInSlice(stopNodes, p) { break } } @@ -589,13 +585,9 @@ func getSiblingNodes(nodes []*html.Node, st siblingType, untilm Matcher, untilNo if st == siblingNextUntil || st == siblingPrevUntil { f = func(n *html.Node) bool { if untilm != nil { - // Matcher-based condition - sel := newSingleSelection(n, nil) - return sel.IsMatcher(untilm) + return untilm.Match(n) } else if len(untilNodes) > 0 { - // Nodes-based condition - sel := newSingleSelection(n, nil) - return sel.IsNodes(untilNodes...) + return isInSlice(untilNodes, n) } return false } @@ -662,6 +654,20 @@ func getChildrenWithSiblingType(parent *html.Node, st siblingType, skipNode *htm } } + // For the cases that collect every matching sibling, count them in a + // cheap pointer walk first so the result slice can be sized exactly, + // avoiding repeated slice growth. The Until cases are skipped (counting + // would require running the predicate twice) and so are the single-result + // Next/Prev cases. + switch st { + case siblingAll, siblingAllIncludingNonElements, siblingPrevAll, siblingNextAll: + n := 0 + for c := iter(nil); c != nil; c = iter(c) { + n++ + } + result = make([]*html.Node, 0, n) + } + for c := iter(nil); c != nil; c = iter(c) { // If this is an ...Until case, test before append (returns true // if the until condition is reached) @@ -681,12 +687,21 @@ func getChildrenWithSiblingType(parent *html.Node, st siblingType, skipNode *htm // Internal implementation of parent nodes that return a raw slice of Nodes. func getParentNodes(nodes []*html.Node) []*html.Node { - return mapNodes(nodes, func(i int, n *html.Node) []*html.Node { - if n.Parent != nil && n.Parent.Type == html.ElementNode { - return []*html.Node{n.Parent} + // Collect parents inline rather than going through mapNodes, which would + // allocate a throwaway one-element slice per source node. Many source + // nodes (e.g. siblings) share the same parent, so deduplicate as we go. + var result []*html.Node + set := make(map[*html.Node]bool, len(nodes)) + + for _, n := range nodes { + p := n.Parent + if p == nil || p.Type != html.ElementNode || set[p] { + continue } - return nil - }) + set[p] = true + result = append(result, p) + } + return result } // Internal map function used by many traversing methods. Takes the source nodes @@ -694,7 +709,14 @@ func getParentNodes(nodes []*html.Node) []*html.Node { // Returns an array of nodes mapped by calling the callback function once for // each node in the source nodes. func mapNodes(nodes []*html.Node, f func(int, *html.Node) []*html.Node) (result []*html.Node) { - set := make(map[*html.Node]bool) + switch len(nodes) { + case 0: + return nil + case 1: + return f(0, nodes[0]) + } + + set := make(map[*html.Node]bool, len(nodes)) for i, n := range nodes { if vals := f(i, n); len(vals) > 0 { result = appendWithoutDuplicates(result, vals, set) diff --git a/src/notifications/vendor/github.com/PuerkitoBio/goquery/type.go b/src/notifications/vendor/github.com/PuerkitoBio/goquery/type.go index 6646c143..dd3778de 100644 --- a/src/notifications/vendor/github.com/PuerkitoBio/goquery/type.go +++ b/src/notifications/vendor/github.com/PuerkitoBio/goquery/type.go @@ -175,22 +175,31 @@ type singleMatcher struct { Matcher } -func (m singleMatcher) MatchAll(n *html.Node) []*html.Node { +// MatchFirst returns the first node that matches, or nil if none does. It uses +// the underlying Matcher's MatchFirst method if it provides one (cascadia- +// compiled matchers all do), avoiding building a result slice. Otherwise it +// falls back to MatchAll and returns its first element. +func (m singleMatcher) MatchFirst(n *html.Node) *html.Node { // Optimized version - stops finding at the first match (cascadia-compiled // matchers all use this code path). if mm, ok := m.Matcher.(interface{ MatchFirst(*html.Node) *html.Node }); ok { - node := mm.MatchFirst(n) - if node == nil { - return nil - } - return []*html.Node{node} + return mm.MatchFirst(n) } // Fallback version, for e.g. test mocks that don't provide the MatchFirst // method. nodes := m.Matcher.MatchAll(n) if len(nodes) > 0 { - return nodes[:1:1] + return nodes[0] + } + return nil +} + +func (m singleMatcher) MatchAll(n *html.Node) []*html.Node { + // Wrap MatchFirst's single result in a slice to respect the Matcher + // interface's MatchAll signature. + if node := m.MatchFirst(n); node != nil { + return []*html.Node{node} } return nil } diff --git a/src/notifications/vendor/github.com/PuerkitoBio/goquery/utilities.go b/src/notifications/vendor/github.com/PuerkitoBio/goquery/utilities.go index 361795b4..49f8dbe6 100644 --- a/src/notifications/vendor/github.com/PuerkitoBio/goquery/utilities.go +++ b/src/notifications/vendor/github.com/PuerkitoBio/goquery/utilities.go @@ -57,6 +57,72 @@ func nodeName(node *html.Node) string { } } +// TextOptions controls the behaviour of the Text function. +type TextOptions struct { + // Separator is inserted between the contents of the text nodes that are + // included in the result. It defaults to the empty string, which + // concatenates the text nodes without any separator. + Separator string + + // Trim, when true, removes leading and trailing whitespace from the + // content of each text node and omits text nodes that are empty once + // trimmed. This is useful to discard the insignificant whitespace that + // comes from the indentation of the source HTML. + Trim bool + + // Keep, when non-nil, is called for each text node encountered while + // traversing the selection. The content of the text node is included in + // the result only if Keep returns true. It can be used, for example, to + // drop the text of