develooper Front page | perl.libwww | Postings from January 2006

Re: HTML::Tree - literal attributes get escaped anyway [PATCH]

Terrence Brannon
January 27, 2006 15:34
Re: HTML::Tree - literal attributes get escaped anyway [PATCH]
Message ID:
Ok test case now passes. Attached file updates Changes, a test case
and HTML/ as needed.

On 1/27/06, Terrence Brannon <> wrote:
> I have added a test to the HTML-Tree svn and plan to post a fix by the
> end of the day, but thought I would give everyone a heads up first.
> The idea is that sometimes you want to toss a bit of javascript into
> an attribute. For example, we want the onclick attribute to look like
> this:
> <tr class="alternate" onclick="window.location.href='/report/fullcsv'">
> but that is currently impossible. It gets rendered like this:
> <tr class="alternate" onclick="window.location.href=&#39;/report/fullcsv&#39;">
> If you try to set the attribute value to a super-literal, then the
> object just gets stringified:
> <tr class="alternate" onclick="HTML::Element=HASH(0x8311dcc)">
> So my strategy is to recognize a super-literal and put
> $literal->{text} in as the value of the attribute without calling the
> encode_entities() routine.
> That's all for now... more later (hopefully in an hour or two),
> --
> Play me in correspondence chess:

Play me in correspondence chess: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About