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: Parse() adds duplicate elements #23487

Open
triamazikamno opened this issue Jan 19, 2018 · 4 comments
Open

x/net/html: Parse() adds duplicate elements #23487

triamazikamno opened this issue Jan 19, 2018 · 4 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@triamazikamno
Copy link

What version of Go are you using (go version)?

go version go1.9.2 darwin/amd64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOOS="darwin"

What did you do?

https://play.golang.org/p/M3PUK90dQhM

What did you expect to see?

<html><head></head><body><strong someAttr=""><a href="some_link"><strong><strong><strong><strong></strong></strong></strong></strong> </a></strong></body></html>

What did you see instead?

<html><head></head><body><strong someattr=""><a href="some_link"><strong><strong><strong><strong></strong></strong></strong></strong></a></strong><a href="some_link"> </a></body></html>

Notice the duplicate <a href="some_link"></a>
From what I understand https://github.com/golang/net/blob/master/html/parse.go#L347 removes identical opening element and before it has a chance to remove respective closing element, reconstructActiveFormattingElements() "fixes" the "broken" structure

@gopherbot gopherbot added this to the Unreleased milestone Jan 19, 2018
@namusyaka
Copy link
Member

Definitely bug. It's occured by including unnecessary space.

@ALTree ALTree added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jan 20, 2018
@namusyaka
Copy link
Member

I'll visit again after resolveing #23071.

@namusyaka
Copy link
Member

@triamazikamno While investigating the issue, I found a fact that the behavior is the same with Chrome's one.
cc @nigeltao

@anthonygedeon
Copy link

Has this been fixed? @namusyaka

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

5 participants