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

x/net/html: Allow getting HTML attribute values without unescape #17667

Open
asciimoo opened this issue Oct 29, 2016 · 1 comment
Open

x/net/html: Allow getting HTML attribute values without unescape #17667

asciimoo opened this issue Oct 29, 2016 · 1 comment

Comments

@asciimoo
Copy link

What version of Go are you using?

go1.7.3

What operating system and processor architecture are you using?

linux/amd64

What did you do?

I'm working on an HTML sanitizer, where I want to access the original escaped HTML attribute values during the parse.

What did you expect to see?

An ideal solution to me would be a flag in the Tokenizer which could indicate if unescaping is required or not when calling TagAttr().
If you find this useful, i can implement it, or if you have any better idea, please reply.

What did you see instead?

As I see, currently the only option is Tokenizer.TagAttr() which automatically unescapes attribute values: https://github.com/golang/net/blob/master/html/token.go#L1158 .
Escaping again the unescaped attribute values can be a solution, but that re-escaping adds computational and structural complexity to the program what I want to avoid if possible.

thanks,
a

@bradfitz bradfitz added this to the Unreleased milestone Oct 29, 2016
@gopherbot
Copy link

Change https://go.dev/cl/405034 mentions this issue: html: allow configuring wether to unescape tag attribute values

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants