[xwiki-users] Double backslahs escaping in links with macro parameters
Hi, i create a macro that renders a link by using macro parameters. The link name should be prefixed with double backslashs. The macro body looks like that: {{velocity}} [[~~\~~\ $xcontext.macro.params.name ">>url:file://$xcontext.macro.params.link||rel="__blank"]] {{/velocity}} Instead of the expected out of "\\Name of the link" I get "\\$ xcontext.macro.params.name". The parameter is only evaluated correctly if I insert a space after the last backlash, so the last backlash prevents the parameter evaluation. How I have to escape the double quots correctly? Best regards Peter
On Wed, Jun 1, 2016 at 7:31 PM, Peter Müller <[email protected]> wrote:
Hi,
i create a macro that renders a link by using macro parameters. The link name should be prefixed with double backslashs.
The macro body looks like that:
{{velocity}} [[~~\~~\ $xcontext.macro.params.name ">>url:file://$xcontext.macro.params.link||rel="__blank"]] {{/velocity}}
Instead of the expected out of "\\Name of the link" I get "\\$ xcontext.macro.params.name". The parameter is only evaluated correctly if I insert a space after the last backlash, so the last backlash prevents the parameter evaluation. How I have to escape the double quots correctly?
Backslash is an escaping character in Velocity. See https://velocity.apache.org/engine/devel/user-guide.html#escapingvalidvtlref... . Hope this helps, Marius
Best regards
Peter _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
participants (2)
-
Marius Dumitru Florea -
Peter Müller