Skip to content

html: UnescapeString documentation error #15221

Closed
@icza

Description

@icza

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions