x/net/html: Allow getting HTML attribute values without unescape #17667
Labels
FeatureRequest
Issues asking for a new feature that does not need a proposal.
Milestone
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 callingTagAttr()
.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
The text was updated successfully, but these errors were encountered: