-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed as not planned
@xrfang Output of
Description
Go version
go version go1.25.0 linux/amd64
Output of go env
in your module/workspace:
AR='ar' CC='gcc' CGO_CFLAGS='-O2 -g' CGO_CPPFLAGS='' CGO_CXXFLAGS='-O2 -g' CGO_ENABLED='1' CGO_FFLAGS='-O2 -g' CGO_LDFLAGS='-O2 -g' CXX='g++' GCCGO='gccgo' GO111MODULE='on' GOAMD64='v1' GOARCH='amd64' GOAUTH='netrc' GOBIN='' GOCACHE='/home/xrfang/.cache/go-build' GOCACHEPROG='' GODEBUG='' GOENV='/home/xrfang/.config/go/env' GOEXE='' GOEXPERIMENT='' GOFIPS140='off' GOFLAGS='' GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build393978095=/tmp/go-build -gno-record-gcc-switches' GOHOSTARCH='amd64' GOHOSTOS='linux' GOINSECURE='' GOMOD='/home/xrfang/git/test/go.mod' GOMODCACHE='/home/xrfang/go/pkg/mod' GONOPROXY='' GONOSUMDB='' GOOS='linux' GOPATH='/home/xrfang/go' GOPRIVATE='' GOPROXY='https://goproxy.cn,direct' GOROOT='/usr/local/go' GOSUMDB='sum.golang.org' GOTELEMETRY='local' GOTELEMETRYDIR='/home/xrfang/.config/go/telemetry' GOTMPDIR='' GOTOOLCHAIN='auto' GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64' GOVCS='' GOVERSION='go1.25.0' GOWORK='' PKG_CONFIG='pkg-config'
What did you do?
package main
import (
"bytes"
"os"
"golang.org/x/net/html"
)
func main() {
src := ` <p class="card-text"><p>Hello World!</p></p>`
doc, _ := html.Parse(bytes.NewReader([]byte(src)))
html.Render(os.Stdout, doc)
}
What did you see happen?
<html><head></head><body><p class="card-text"></p><p>Hello World!</p><p></p></body></html>
What did you expect to see?
<html><head></head><body><p class="card-text"><p>Hello World!</p></p></body></html>