BorisMoore / jsrender

A lightweight, powerful and highly extensible templating engine. In the browser or on Node.js, with or without jQuery.
http://www.jsviews.com
MIT License
2.67k stars 339 forks source link

Conflict with Liquid syntax #281

Closed NathanHazout closed 8 years ago

NathanHazout commented 8 years ago

My site is generated by Jekyll, which uses Liquid as a templating language. They also use {{ }} to print variables.

When typing

<script id="myTemplate" type="text/x-jsrender">
Name: {{:name}}
</script>

{{:name}} gets rendered as an empty string before jsrender can catch it.

What are my options?

NathanHazout commented 8 years ago

I found my workaround:

{% raw %}{{:name}}{% endraw %}

BorisMoore commented 8 years ago

Ok - but alternatively you can use choose different delimiters, such as <%...%> using $.views.settings.delimiters("<%", "%>").

See: https://github.com/BorisMoore/jsrender/issues/258