Josh,
Yes there is a bug. Here's the fix:
cvs diff: Diffing .
cvs diff: Diffing lib
cvs diff: Diffing lib/Petal
cvs diff: Diffing lib/Petal/Utils
Index: lib/Petal/Utils/Decode.pm
===================================================================
RCS file: /home/wsmith/cvs/Petal-Utils/lib/Petal/Utils/Decode.pm,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 Decode.pm
30a31
> return undef;
cvs diff: Diffing t
Index: t/25__Decode.t
===================================================================
RCS file: /home/wsmith/cvs/Petal-Utils/t/25__Decode.t,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 25__Decode.t
17a18,19
> my $str3 = "checked";
> my $str4 = undef;
22a25,26
> str3 => $str3,
> str4 => $str4,
47a52,54
> like($out, qr/decode16: <input[^>]*checked="checked"/, 'decode16');
> unlike($out, qr/decode17: <input[^>]*checked=/, 'decode17');
>
cvs diff: Diffing t/data
Index: t/data/25__decode.html
===================================================================
RCS file: /home/wsmith/cvs/Petal-Utils/t/data/25__decode.html,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 25__decode.html
40a41,44
> <!--? conditional attributes -->
> decode16: <input type="checkbox" tal:attributes="checked
decode:$str3 'checked' 'checked'" />
> decode17: <input type="checkbox" tal:attributes="checked
decode:$str4 'checked' 'checked'" />
>
What exactly is it supposed to mean, the phrase "decode:" ?
I also don't have it working as advertised. Not sure whether it is a bug
or not.
extra =
[
{
c=>1,
short=>'One Thing',
selected=>'selected',
},
{
c=>2,
short=>'Another',
}
]
<select name="c">
<option petal:repeat="e extra" petal:content="e/short"
petal:attributes="value e/c;
selected decode: e/selected 'selected' 'selected'" />
</select>
The selected attribute is correct for c=1, but I get selected="0" for
c=2. That doesn't seem right.
Thanks in advance,
Josh
|