Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set delimeters inside squiggly braces not handled properly #41

Open
ewollesen opened this issue Nov 3, 2014 · 0 comments
Open

set delimeters inside squiggly braces not handled properly #41

ewollesen opened this issue Nov 3, 2014 · 0 comments

Comments

@ewollesen
Copy link

I'm trying to use clostache to insert values into a latex template. I've changed the set delimeters to <% %> because {{ occurs in latex. However, I ran into a case where I have a template like the following:

\name{<% name %>}

The resulting template (when name is "Foo") is:

\nameFoo

I looked at the code, and this seems to be a result of process-set-delimiters replacing instances of the chosen delimiters with {{ and }}, so in my example, after process-set-delimiters, template becomes:

\name{{{ name }}}

And because mustache uses {{{ as a delimiter for unescaped insertion, this is a problem. I've tested this using mustache from the command-line, and there it works as expected.

Here's a failing test case:

(deftest test-set-delimiters-with-curly-braces
  (is (= (render "{{=<% %>=}}\n{<% foo %>}" {:foo "bar"}) "{bar}")))

I looked at the code, but sadly, I'm very new to clojure and so I'm a little lost as to how to proceed to resolve this situation. If you could give me any pointers as to how this might be solved, I'll be glad to make an attempt at it.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant