HTML::Tree - literal attributes get escaped anyway

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=3D"alternate" onclick=3D"window.location.href=3D'/report/fullcsv'=
">

but that is currently impossible. It gets rendered like this:

<tr class=3D"alternate" onclick=3D"window.location.href=3D'/report/full=
csv'">

If you try to set the attribute value to a super-literal, then the
object just gets stringified:

<tr class=3D"alternate" onclick=3D"HTML::Element=3DHASH(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:
http://slowchess.com/profile.php?username=3Dtbrannon
metaperl [ Fr, 27 Januar 2006 17:19 ] [ ID #1162034 ]
Perl » perl.libwww » HTML::Tree - literal attributes get escaped anyway

Vorheriges Thema: Re: HTML::Tree - literal attributes get escaped anyway [PATCH]
Nächstes Thema: URI.pm error