whisker icon indicating copy to clipboard operation
whisker copied to clipboard

Problem with {{, even when changing delimiters

Open gerrymanoim opened this issue 8 years ago • 2 comments

I've been trying to get whisker working with LaTeX (which uses a lot of braces)

At first I thought it wouldn't be an issue since there's proper nesting:

> template <- 
+ 
+ 'Hello {{{{name}}}}
+ You have just won ${{value}}!
+ 
+ '
> text <- whisker.render(template, data)
> cat(text)
Hello 
You have just won $10000!

So I thought, fine, I'll just switch the delimeters:

> template <- 
+ '
+ {{=<% %>=}}
+ Hello {{<%name%>}}
+ You have just won ${{<%value%>}}!
+ 
+ '
> text <- whisker.render(template, data)
> cat(text)

Hello ~~~~~~~~~~~~~Chris{{
You have just won $}}10000~~~~~~~~~~~~~!

Which is a bit weird? Apologies if I'm just doing something incorrectly.

gerrymanoim avatar Dec 03 '15 03:12 gerrymanoim

Is this issue still on the agenda? This blocks us in the linked PR above.

pat-s avatar Sep 25 '19 15:09 pat-s

The new delimiter (<%) should not include the {{= part, so your template should be:

{{=<% %>=}}
Hello <%name%>
You have just won $<%value%>!

cole-brokamp avatar Nov 19 '21 21:11 cole-brokamp