develooper Front page | perl.libwww | Postings from November 2001

Re: HTML::Parser handling of textarea

Gisle Aas
November 20, 2001 11:39
Re: HTML::Parser handling of textarea
Message ID:
Alex Shinn <> writes:

> I've been working on an application with a template engine that expects
> to be able to parse nested tags within a <textarea>.  The original
> development was done on HTML::Parser 3.19, but when I recently upgraded
> I discovered that as of 3.22 this behaviour was changed to parse
> textarea in literal mode.


> This seems a little odd to me, though I guess textarea is kind of an odd
> tag to begin with.  As your message in the mailing list says
> (,
> browsers handle textarea in a somewhat CDATA mode.  However, HTML
> generators and more general parsers know that textarea does not receive
> such special behaviour from the standard, and expect to be able to parse
> into it.  In such a generator, tags such as <b> would be handled or
> reproduced as they normally would, and then it would be up to the
> browser to do the special processing of the textarea contents.
> As a temporary workaround, I've simply commented out the line in my
> local HTML::Parser code referring to textarea, and I have a few other
> workarounds I can use.  But it might be nice if there were a cleaner
> option or method I could call to toggle the textarea behaviour.

An option to toggle this behaviour would be fine with me.  I don't
think I can find time to do it myself, but I'm likely to apply a
contributed patch.

You could also consider creating a new parser object and then tell it
to parse the text the first parser found in the textarea.

Gisle Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About