Java Mailing List Archive

http://www.junlu.com/

Home » FreeMarker-user »

Re: [FreeMarker-user] Calling macro with tricky parameter name

Daniel Dekany

2012-02-24

Replies: Find Java Web Hosting

Author LoginPost Reply
Friday, February 24, 2012, 8:20:37 AM, Jerker Klang wrote:

> First thank you for your reply Daniel.
>
> On 02/22/2012 05:48 PM, Daniel Dekany wrote:
>> Wednesday, February 22, 2012, 4:21:31 PM, Jerker Klang wrote:
>>
>>> ...
>>>
>>> Question: How do I call that macro with parameter named data-custom with
>>> the value freemarker?
>> As far as I see, you just can't do that. You will have to use '_'
>> instead, and then ?replace('_', '-') it where you print it. /-:
>
>>> The naive aproach would have been:
>>>
>>> <@(protected)" />
>>>
>>> Background:
>>> In html5 they have the new convention that you can enter custom data
>>> attributes on elements by using a data- prefix on all attributes. I
>>> suspect that my question is likely to reoccur in the future as html5
>>> becomes more common.
>> Yeah... it should be improved in the parser. Except, it can't be done
>> in a backward-compatible way.<@(protected)
>> <@(protected)
>> '=='.
>>
> Unfortunate but I understand that this is far from a quick fix. I'll
> have to do with the underscore approach and hope that nobody here needs
> a attribute name with one in it
>
> However I would still like this issue to be noted somewhere. I'm gonna
> file a bug report in it so that it is at least noted as a "wanted feature".

You should fill a request-for-enchantment.

BTW, there's a "emulate_2_3_parser_bugs" setting starting from 2.3.19.
When that's set to false, foo-bar = exp (with single "="!) should be
treated as an assignment to "foo-bar". That would be the solution, I
believe.

> Have a nice day!
>
> //Jerker
>
> ------------------------------------------------------------------------------
> Virtualization & Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing
> also focuses on allowing computing to be delivered as a service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
> _______________________________________________
> FreeMarker-user mailing list
> FreeMarker-user@(protected)
> https://lists.sourceforge.net/lists/listinfo/freemarker-user
>

--
Best regards,
Daniel Dekany


------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
FreeMarker-user mailing list
FreeMarker-user@(protected)
https://lists.sourceforge.net/lists/listinfo/freemarker-user
©2008 junlu.com - Jax Systems, LLC, U.S.A.