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

can't get the textarea element #178

Open
ychaouche opened this issue Sep 6, 2022 · 1 comment
Open

can't get the textarea element #178

ychaouche opened this issue Sep 6, 2022 · 1 comment

Comments

@ychaouche
Copy link

ychaouche commented Sep 6, 2022

In this HTML

$ cat TMP/textarea
<!doctype html>
<html>
  <body>
    <div class="contentRead" id="target">
      <noscript>
        <textarea name="content">essai 3</textarea>
      </noscript>
    </div>
  </body>
</html>
$

pup can't find textarea

$ pup textarea < TMP/textarea
$ 

Also, I noticed something strange when I select noscript.

$ pup noscript < TMP/textarea
<noscript>
 &lt;textarea name=&#34;content&#34;&gt;essai 3&lt;/textarea&gt;
</noscript>
$

Thoughts?

@ychaouche ychaouche changed the title can't get the textattribute element can't get the textarea element Sep 6, 2022
@gromgit
Copy link

gromgit commented Sep 7, 2022

It's a (very old) Go HTML parser issue, that treats <noscript> content as text: golang/go#16318

It's fixed in <head>, but not in <body>:

$ cat test.html
<!doctype html>
<html>
  <head>
    <textarea name="nonsense">essai 2</textarea>
  </head>
  <body>
    <div class="contentRead" id="target">
      <noscript>
        <textarea name="content">essai 3</textarea>
      </noscript>
    </div>
  </body>
</html>

$ pup textarea < test.html
<textarea name="nonsense">
 essai 2
</textarea>

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

No branches or pull requests

2 participants