Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

html: sync changes from x/net #66970

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/html/escape.go
Expand Up @@ -56,7 +56,7 @@ var replacementTable = [...]rune{
func unescapeEntity(b []byte, dst, src int) (dst1, src1 int) {
const attribute = false

// http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#consume-a-character-reference
// https://html.spec.whatwg.org/multipage/syntax.html#consume-a-character-reference

// i starts at 1 because we already know that s[0] == '&'.
i, s := 1, b[src:]
Expand Down Expand Up @@ -169,6 +169,7 @@ var htmlEscaper = strings.NewReplacer(
`<`, "&lt;",
`>`, "&gt;",
`"`, "&#34;", // "&#34;" is shorter than "&quot;".
"\r", "&#13;",
)

// EscapeString escapes special characters like "<" to become "&lt;". It
Expand Down