automatically ignore known forwarded addresses, fixes #64
This commit is contained in:
28
vendor/golang.org/x/net/html/render.go
generated
vendored
28
vendor/golang.org/x/net/html/render.go
generated
vendored
@@ -194,9 +194,8 @@ func render1(w writer, n *Node) error {
|
||||
}
|
||||
}
|
||||
|
||||
// Render any child nodes.
|
||||
switch n.Data {
|
||||
case "iframe", "noembed", "noframes", "noscript", "plaintext", "script", "style", "xmp":
|
||||
// Render any child nodes
|
||||
if childTextNodesAreLiteral(n) {
|
||||
for c := n.FirstChild; c != nil; c = c.NextSibling {
|
||||
if c.Type == TextNode {
|
||||
if _, err := w.WriteString(c.Data); err != nil {
|
||||
@@ -213,7 +212,7 @@ func render1(w writer, n *Node) error {
|
||||
// last element in the file, with no closing tag.
|
||||
return plaintextAbort
|
||||
}
|
||||
default:
|
||||
} else {
|
||||
for c := n.FirstChild; c != nil; c = c.NextSibling {
|
||||
if err := render1(w, c); err != nil {
|
||||
return err
|
||||
@@ -231,6 +230,27 @@ func render1(w writer, n *Node) error {
|
||||
return w.WriteByte('>')
|
||||
}
|
||||
|
||||
func childTextNodesAreLiteral(n *Node) bool {
|
||||
// Per WHATWG HTML 13.3, if the parent of the current node is a style,
|
||||
// script, xmp, iframe, noembed, noframes, or plaintext element, and the
|
||||
// current node is a text node, append the value of the node's data
|
||||
// literally. The specification is not explicit about it, but we only
|
||||
// enforce this if we are in the HTML namespace (i.e. when the namespace is
|
||||
// "").
|
||||
// NOTE: we also always include noscript elements, although the
|
||||
// specification states that they should only be rendered as such if
|
||||
// scripting is enabled for the node (which is not something we track).
|
||||
if n.Namespace != "" {
|
||||
return false
|
||||
}
|
||||
switch n.Data {
|
||||
case "iframe", "noembed", "noframes", "noscript", "plaintext", "script", "style", "xmp":
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// writeQuoted writes s to w surrounded by quotes. Normally it will use double
|
||||
// quotes, but if s contains a double quote, it will use single quotes.
|
||||
// It is used for writing the identifiers in a doctype declaration.
|
||||
|
||||
9
vendor/golang.org/x/net/html/token.go
generated
vendored
9
vendor/golang.org/x/net/html/token.go
generated
vendored
@@ -913,7 +913,14 @@ func (z *Tokenizer) readTagAttrKey() {
|
||||
case ' ', '\n', '\r', '\t', '\f', '/':
|
||||
z.pendingAttr[0].end = z.raw.end - 1
|
||||
return
|
||||
case '=', '>':
|
||||
case '=':
|
||||
if z.pendingAttr[0].start+1 == z.raw.end {
|
||||
// WHATWG 13.2.5.32, if we see an equals sign before the attribute name
|
||||
// begins, we treat it as a character in the attribute name and continue.
|
||||
continue
|
||||
}
|
||||
fallthrough
|
||||
case '>':
|
||||
z.raw.end--
|
||||
z.pendingAttr[0].end = z.raw.end
|
||||
return
|
||||
|
||||
BIN
vendor/golang.org/x/net/publicsuffix/data/children
generated
vendored
BIN
vendor/golang.org/x/net/publicsuffix/data/children
generated
vendored
Binary file not shown.
BIN
vendor/golang.org/x/net/publicsuffix/data/nodes
generated
vendored
BIN
vendor/golang.org/x/net/publicsuffix/data/nodes
generated
vendored
Binary file not shown.
2
vendor/golang.org/x/net/publicsuffix/data/text
generated
vendored
2
vendor/golang.org/x/net/publicsuffix/data/text
generated
vendored
File diff suppressed because one or more lines are too long
14
vendor/golang.org/x/net/publicsuffix/table.go
generated
vendored
14
vendor/golang.org/x/net/publicsuffix/table.go
generated
vendored
@@ -4,7 +4,7 @@ package publicsuffix
|
||||
|
||||
import _ "embed"
|
||||
|
||||
const version = "publicsuffix.org's public_suffix_list.dat, git revision e248cbc92a527a166454afe9914c4c1b4253893f (2022-11-15T18:02:38Z)"
|
||||
const version = "publicsuffix.org's public_suffix_list.dat, git revision 63cbc63d470d7b52c35266aa96c4c98c96ec499c (2023-08-03T10:01:25Z)"
|
||||
|
||||
const (
|
||||
nodesBits = 40
|
||||
@@ -26,7 +26,7 @@ const (
|
||||
)
|
||||
|
||||
// numTLD is the number of top level domains.
|
||||
const numTLD = 1494
|
||||
const numTLD = 1474
|
||||
|
||||
// text is the combined text of all labels.
|
||||
//
|
||||
@@ -63,8 +63,8 @@ var nodes uint40String
|
||||
//go:embed data/children
|
||||
var children uint32String
|
||||
|
||||
// max children 718 (capacity 1023)
|
||||
// max text offset 32976 (capacity 65535)
|
||||
// max text length 36 (capacity 63)
|
||||
// max hi 9656 (capacity 16383)
|
||||
// max lo 9651 (capacity 16383)
|
||||
// max children 743 (capacity 1023)
|
||||
// max text offset 30876 (capacity 65535)
|
||||
// max text length 31 (capacity 63)
|
||||
// max hi 9322 (capacity 16383)
|
||||
// max lo 9317 (capacity 16383)
|
||||
|
||||
Reference in New Issue
Block a user