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

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

Thanks alot guys for all the feedback and suggested solutions!

The solution with #%% this is not parsed at all %%# looks perfect to me (and 
consistent like Nathan mentioned in the comment before me)
Indeed, should anyone still need #%% sequence in that block (I can not 
immediately point this to any syntax I know off, so prob quite unlikely) there 
are work arounds like with the #include('bla.txt') I'm using now ;)

Can someone give me a pointer as to which "stable" release this fix could go 
in? I need to run this in a secure production environment so can't really start 
patching libraries myself...

> 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
>         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