Skip to content

Commit 705c34a

Browse files
committed
Updated x/net/html to ensure latest version from the Go team, retracted v1.0.19 to ensure the latest version is used
1 parent 84409dd commit 705c34a

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

go.mod

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
module github.com/microcosm-cc/bluemonday
22

3-
go 1.18
3+
go 1.19
44

55
require (
66
github.com/aymerick/douceur v0.2.0
7-
golang.org/x/net v0.0.0-20210614182718-04defd469f4e
7+
golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b
88
)
99

1010
require github.com/gorilla/css v1.0.0 // indirect
1111

1212
retract [v1.0.0, v1.0.18] // Retract older versions as only latest is to be depended upon
13+
retract v1.0.19 // Uses older version of golang.org/x/net

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuP
22
github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4=
33
github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY=
44
github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c=
5-
golang.org/x/net v0.0.0-20210614182718-04defd469f4e h1:XpT3nA5TvE525Ne3hInMh6+GETgn27Zfm9dxsThnX2Q=
6-
golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
5+
golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b h1:ZmngSVLe/wycRns9MKikG9OWIEjGcGAkacif7oYQaUY=
6+
golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=

sanitize_test.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1602,9 +1602,17 @@ func TestComments(t *testing.T) {
16021602
in: `1 <!-- 2 --> 3`,
16031603
expected: `1 <!-- 2 --> 3`,
16041604
},
1605+
// Note that prior to go1.19 this test worked and preserved HTML comments
1606+
// of the style used by Microsoft to create browser specific sections.
1607+
//
1608+
// However as @zhsj notes https://github.com/microcosm-cc/bluemonday/pull/148
1609+
// the commit https://github.com/golang/net/commit/06994584 broke this.
1610+
//
1611+
// I haven't found a way to allow MS style comments without creating a risk
1612+
// for every user of bluemonday that utilises .AllowComments()
16051613
{
16061614
in: `<!--[if gte mso 9]>Hello<![endif]-->`,
1607-
expected: `<!--[if gte mso 9]>Hello<![endif]-->`,
1615+
expected: `<!--[if gte mso 9]&gt;Hello&lt;![endif]-->`,
16081616
},
16091617
}
16101618

0 commit comments

Comments
 (0)