Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Elements inside <noscript> are ignored? #14

Closed
0xbzho opened this issue Apr 23, 2016 · 3 comments
Closed

Elements inside <noscript> are ignored? #14

0xbzho opened this issue Apr 23, 2016 · 3 comments

Comments

@0xbzho
Copy link

0xbzho commented Apr 23, 2016

The following test fails; shouldn't it pass?

diff --git a/selector_test.go b/selector_test.go
index 8438d38..b372cf9 100644
--- a/selector_test.go
+++ b/selector_test.go
@@ -35,6 +35,11 @@ var selectorTests = []selectorTest{
                },
        },
        {
+               `<noscript><img src=foo/></noscript>`,
+               "img",
+               []string{"<img src=\"foo/\">"},
+       },
+       {
                `<html><head></head><body></body></html>`,
                "*",
                []string{
@andybalholm
Copy link
Owner

The net/html parser parses the document as if javascript were enabled. Because of that, the contents of noscript elements are just a single text node, not parsed HTML elements.

@0xbzho
Copy link
Author

0xbzho commented Apr 23, 2016

Ah. So this is working as intended?

@andybalholm
Copy link
Owner

Right.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants