diff --git a/go.mod b/go.mod index cb1660f..a8e57e7 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/sashabaranov/go-openai v1.43.0 github.com/stretchr/testify v1.12.1 go.mongodb.org/mongo-driver/v2 v2.9.2 - golang.org/x/net v0.61.0 + golang.org/x/net v0.62.0 ) require ( diff --git a/go.sum b/go.sum index 6157096..8a243f6 100644 --- a/go.sum +++ b/go.sum @@ -412,8 +412,8 @@ golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/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.61.0 h1:RR+6j/BTBCrggOLugxa+66R8FvoN6MHlzDlZIbN9YFw= -golang.org/x/net v0.61.0/go.mod h1:WgDCOTH8iwtB66T4/GfI94AHo/hhdb7Hah9NDseQfiI= +golang.org/x/net v0.62.0 h1:18ELalfM5+XNRwzM2nYqXsZQ9ByS1uhj2O/U7+5jqRY= +golang.org/x/net v0.62.0/go.mod h1:WgDCOTH8iwtB66T4/GfI94AHo/hhdb7Hah9NDseQfiI= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= diff --git a/vendor/golang.org/x/net/html/parse.go b/vendor/golang.org/x/net/html/parse.go index 165b610..a99cee6 100644 --- a/vendor/golang.org/x/net/html/parse.go +++ b/vendor/golang.org/x/net/html/parse.go @@ -51,6 +51,9 @@ type parser struct { // context is the context element when parsing an HTML fragment // (section 12.4). context *Node + // textNodes holds buffers for TextNodes that have had multiple text + // tokens coalesced into them. + textNodes map[*Node][]byte } func (p *parser) top() *Node { @@ -292,7 +295,7 @@ func (p *parser) fosterParent(n *Node) { prev = parent.LastChild } if prev != nil && prev.Type == TextNode && n.Type == TextNode { - prev.Data += n.Data + p.appendText(prev, n.Data) return } @@ -316,7 +319,7 @@ func (p *parser) addText(text string) { t := p.top() if n := t.LastChild; n != nil && n.Type == TextNode { - n.Data += text + p.appendText(n, text) return } p.addChild(&Node{ @@ -325,6 +328,18 @@ func (p *parser) addText(text string) { }) } +func (p *parser) appendText(n *Node, text string) { + if p.textNodes == nil { + p.textNodes = make(map[*Node][]byte) + } + b, ok := p.textNodes[n] + if !ok { + b = []byte(n.Data) + n.Data = "" + } + p.textNodes[n] = append(b, text...) +} + func attrCompare(a, b Attribute) int { return cmp.Or( cmp.Compare(a.Namespace, b.Namespace), @@ -2242,6 +2257,10 @@ func (p *parser) parse() (err error) { } p.parseCurrentToken() } + for n, b := range p.textNodes { + n.Data = string(b) + } + p.textNodes = nil return nil } diff --git a/vendor/golang.org/x/net/html/render.go b/vendor/golang.org/x/net/html/render.go index 767eeae..f356d48 100644 --- a/vendor/golang.org/x/net/html/render.go +++ b/vendor/golang.org/x/net/html/render.go @@ -246,18 +246,17 @@ func childTextNodesAreLiteral(n *Node) bool { switch n.Data { case "iframe", "noembed", "noframes", "noscript", "plaintext", "script", "style", "xmp": - // We need to check if n is a node that was fostered from a HTML namespace - // into a non-HTML namespace (in which case, different rules apply to it). - // We do this by walking up the tree until we find a node with a non-empty - // namespace. If we find such a node, we also have to check if it's - // an HTML integration point. If it isn't, then the node we're currently - // looking at is foster-parented and we should return false. - for p := n.Parent; p != nil; p = p.Parent { - if p.Namespace != "" { - if !htmlIntegrationPoint(p) { - return false - } - break + // n's text is literal only if the parser would keep n in the HTML + // namespace when the output is re-parsed. An ancestor may have been + // fostered under a foreign element (such as an HTML under + // ) where the parser would instead create it, and its + // descendants, in that element's namespace. We walk up the whole tree + // and check that every transition out of a non-HTML namespace happens + // at an HTML integration point. This is stricter than the parser, so + // some text that would be safe literally is escaped. + for c, p := n, n.Parent; p != nil; c, p = p, p.Parent { + if p.Namespace != "" && p.Namespace != c.Namespace && !htmlIntegrationPoint(p) { + return false } } diff --git a/vendor/modules.txt b/vendor/modules.txt index b521313..57844c7 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -542,7 +542,7 @@ golang.org/x/crypto/pbkdf2 golang.org/x/crypto/scrypt golang.org/x/crypto/ssh golang.org/x/crypto/ssh/internal/bcrypt_pbkdf -# golang.org/x/net v0.61.0 +# golang.org/x/net v0.62.0 ## explicit; go 1.26.0 golang.org/x/net/html golang.org/x/net/html/atom