Commas are normally used inside map to separate different templates to
apply to data (e.g. if you want alternate color background in the row of
a table).
If you have a normal comma inside the map you have to escape it with a
backslash. This case was not handled properly.
I've integrated the fix both in the main trunk and in the TRY-yaws-tei
branch.
cheers,
filippo
I still have some problems with the comma character.
(Sorry if this mail ends up twice, I tried to send to the
mail addres, but it didn't seem to go through, so now
I'm doing a reply from within the group-page)
I'm trying ty expand the following:
$map:{"#$owner$": function(t) {save_owner("$owner$"\,t.id);}\,} owners
$
But I get:
"#tobbe": function(t) {save_owner("tobbe",t.id);}\"#bill": function(t)
{save_owner("bill",t.id);}\
and if i change to:
$map:{"#$owner$": function(t) {save_owner("$owner$"\,t.id);},} owners$
then I get:
"#tobbe": function(t) {save_owner("tobbe",t.id);}"#bill": function(t)
{save_owner("bill",t.id);}
The correct ouput that i do want to get is:
"#tobbe": function(t) {save_owner("tobbe",t.id);},"#bill": function(t)
{save_owner("bill",t.id);}
So:
1. Perhaps ',' is not a good character to have a SGTE meaning.
(since it often is used in javascript)
2. Perhaps a 'mapj' (map-join) would be nice, to get rid of the last
',' character.
Cheers, Tobbe
etnt wrote:
> Hi,
>
> I still have some problems with the comma character.
> (Sorry if this mail ends up twice, I tried to send to the
> mail addres, but it didn't seem to go through, so now
> I'm doing a reply from within the group-page)
Strange I'll take a look at the log files on the server.
> ... snip ...
Yes I still have a bug with commas.
>
> So:
>
> 1. Perhaps ',' is not a good character to have a SGTE meaning.
> (since it often is used in javascript)
Yes it was really a bad choice.
>
> 2. Perhaps a 'mapj' (map-join) would be nice, to get rid of the last
> ',' character.
What do you mean with mapj? a map and then a join passing a character?
Something like $mapj someTmpl attrList joinChar$?
I was already planning a mapList to map on a list of values. What do you
think about this solution?
- map as it should work now
- mapl to map on list of values
- mmap to map over multiple templates using a different separator from ','
Meanwhile, since you don't use multiple templates, attached there's a
modified version you can use. remove the escape before ',' and it should
work.
cheers,
filippo