[ 
https://issues.apache.org/jira/browse/VELOCITY-661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12661658#action_12661658
 ] 

ND commented on VELOCITY-661:
-----------------------------

Thanks guys for all the effort, in the end, I don't really care if I have to 
type #[[ #%% or #(( , so whatever worked technically is perfect :)
Good point about the required space cause I personnally tend to type (and a lot 
more people I suppose for readability) :

#[[
my
unparsed
content
which can be
pretty long
]]#

which would indeed fail if I forgot to put spaces in, and that might be very 
confusing/hard to spot

Anyway, thanks alot, now just waiting for 1.7 to be released ;) In the 
meanwhile, I'll try out your test build in my project and let you know how that 
works out (we have some 150 templates, some over 5000 lines and we're using 
pretty "exotic constructs" here and there so I think it's a pretty good 
real-life test ;) )

> Parsing errors on content inside #literal() #end block
> ------------------------------------------------------
>
>                 Key: VELOCITY-661
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-661
>             Project: Velocity
>          Issue Type: Improvement
>          Components: Engine
>    Affects Versions: 1.6.1
>         Environment: ALL
>            Reporter: ND
>             Fix For: 1.7
>
>         Attachments: velocity-661-v1.0.patch
>
>
> I have some velocity templates that include quit some javascript. Inside the 
> javascript a javascrip template engine is used which also uses ${varname}
> Escaping each occurance would make the code rather unreable, so to prevent 
> velocity from parsing the javascript code, I put a #literal() around it.
> However, velocity still PARSES the contents of this block, which of course 
> results in parsing exceptions.
> My feeling with "literal" is that it is completely UNINTERPRETED content?
> This SHOULD work:
> #literal()
>  var myId = 'someID';
>  $('#test).append($.template('<div id="${myId}"></div>').apply({myId: myId}));
> #end

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to