Skip Menu |

This queue is for tickets about the HTML-Tree CPAN distribution.

Report information
The Basics
Id: 17329
Status: resolved
Priority: 0/
Queue: HTML-Tree

People
Owner: Nobody in particular
Requestors: andy [...] petdance.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Fwd: HTML::Tree - literal attributes get escaped anyway [PATCH]
Date: Fri, 27 Jan 2006 21:18:07 -0600
To: bug-html-tree [...] rt.cpan.org
From: Andy Lester <andy [...] petdance.com>
Begin forwarded message: Show quoted text
> From: Terrence Brannon <metaperl@gmail.com> > Date: January 27, 2006 5:35:54 PM CST > To: Andy Lester <andy@petdance.com> > Subject: Fwd: HTML::Tree - literal attributes get escaped anyway > [PATCH] > > Ok, I b0rked your email address on the last send. This will make it > to you. > > ---------- Forwarded message ---------- > From: Terrence Brannon <metaperl@gmail.com> > Date: Jan 27, 2006 3:34 PM > Subject: Re: HTML::Tree - literal attributes get escaped anyway > [PATCH] > To: andy@petdance.coml > Cc: libwww@perl.org > > > Ok test case now passes. Attached file updates Changes, a test case > and HTML/Element.pm as needed. > > On 1/27/06, Terrence Brannon <metaperl@gmail.com> 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: >> http://slowchess.com/profile.php?username=tbrannon >>
> > > -- > Play me in correspondence chess: > http://slowchess.com/profile.php?username=tbrannon > > > > > -- > Play me in correspondence chess: > http://slowchess.com/profile.php?username=tbrannon
-- Andy Lester => andy@petdance.com => www.petdance.com => AIM:petdance


Begin forwarded message:

Show quoted text
From: Terrence Brannon <metaperl@gmail.com>
Date: January 27, 2006 5:35:54 PM CST
To: Andy Lester <andy@petdance.com>
Subject: Fwd: HTML::Tree - literal attributes get escaped anyway [PATCH]

Ok, I b0rked your email address on the last send. This will make it to you.

---------- Forwarded message ----------
From: Terrence Brannon <metaperl@gmail.com>
Date: Jan 27, 2006 3:34 PM
Subject: Re: HTML::Tree - literal attributes get escaped anyway [PATCH]


Ok test case now passes. Attached file updates Changes, a test case
and HTML/Element.pm as needed.

On 1/27/06, Terrence Brannon <metaperl@gmail.com> 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:




--
Play me in correspondence chess:

Message body is not shown because sender requested not to inline it.

Show quoted text

--
Andy Lester => andy@petdance.com => www.petdance.com => AIM:petdance



Resolved in release 3.17_01