x/net/html: Text() corrupts underlying tokenizer buffer #43268
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I just wanted to verify the intent of the tokenizer interface. According to the documentation for
Raw
,In the case of escaped characters, in this example, I notice the underlying buffer returned by
Raw
gets partially updated after a call toText
with the unescaped version of the character but parts of the escaped character still exist. For example, if the original buffer wasa<b
, after a call toText()
, the buffer looks likea<bt;b
. This behavior seems correct according to the documentation but I wanted to verify this is consistent with the intent ofRaw
. It seems to limit the usefulness ofRaw
when used withNext
andText
.What did you expect to see?
I was hoping to see the escaped character completely replaced in the underlying buffer returned by
Raw()
(a<b
).What did you see instead?
The underlying buffer looks like
a<bt;b
.The text was updated successfully, but these errors were encountered: