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: UnescapeString documentation error #15221

Closed
icza opened this issue Apr 10, 2016 · 1 comment
Closed

html: UnescapeString documentation error #15221

icza opened this issue Apr 10, 2016 · 1 comment

Comments

@icza
Copy link

icza commented Apr 10, 2016

Go 1.6, Go Playground environment

Documentation of html.UnescapeString() contains a mistake. Quoting:

It unescapes a larger range of entities than EscapeString escapes. For example, "á" unescapes to "á", as does "á" and "&xE1;".

It should be á (there is a missing hashmark # in the doc).

The implementation is good, but it is documented falsely.

fmt.Println(html.UnescapeString(`&xE1;`))  // Output: &xE1;
fmt.Println(html.UnescapeString(`á`)) // Output: á

Output is as expected.

Playground example:

http://play.golang.org/p/S5EaiVfMKs

@bradfitz bradfitz self-assigned this Apr 10, 2016
@bradfitz bradfitz added this to the Go1.7 milestone Apr 10, 2016
@bradfitz bradfitz changed the title html.UnescapeString() documentation error html: UnescapeString documentation error Apr 10, 2016
@gopherbot
Copy link

CL https://golang.org/cl/21798 mentions this issue.

@golang golang locked and limited conversation to collaborators Apr 10, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants