-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: html entity escape error #48237
Comments
Change https://golang.org/cl/354929 mentions this issue: |
Thanks for the report, @WebFeng. At least your expectation looks like same with the behavior on chrome. As far as I read this page, I haven't found any mention of escaped entities in comment, but I don't think it's necessary to treat the data as escaped when it comes to comment token. cc @nigeltao |
Hi, I got similar issue with package main
import (
"fmt"
"log"
"strings"
"golang.org/x/net/html"
)
func main() {
var htm = `
<html>
<body>
<!--!-->
<div>text</div>
</body>
</html>
`
node, err := html.Parse(strings.NewReader(htm))
if err != nil {
log.Fatalln(err)
}
fmt.Println(node.LastChild.LastChild.LastChild.Data)
} output:
|
Change https://go.dev/cl/419334 mentions this issue: |
Change https://go.dev/cl/442496 mentions this issue: |
Fixes golang/go#48237 Change-Id: I309e3ad30684fb71b9b3e67dfac156da08dbc69b Reviewed-on: https://go-review.googlesource.com/c/net/+/419334 Run-TryBot: Nigel Tao <nigeltao@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Kunpei Sakai <namusyaka@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org>
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?
What did you expect to see?
What did you see instead?
refer:PuerkitoBio/goquery#391
The text was updated successfully, but these errors were encountered: