Skip to content

can't get the textarea element #178

Open

Description

@ychaouche

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?

Activity

  1. changed the title [-]can't get the textattribute element[/-] [+]can't get the textarea element[/+] on Sep 6, 2022
  2. gromgit commented on Sep 7, 2022

    @gromgit

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions