question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to change JsRender template tags (delimiters)?

See original GitHub issue

I use Twig. It uses these tags: {{ name }}

I want to include JsRender in my project. But JsRender also uses the same tags {{:name}}, so there is a conflict and nothing works. How to change default JsRender tags with custom tags, say Ruby-like <%= name %>

Question on Stackoverflow: http://stackoverflow.com/questions/29493005/how-to-change-jsrender-template-tags

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
BorisMoorecommented, Apr 7, 2015

JsRender let’s you change the delimiters, like this:

$.views.settings.delimiters("<%", "%>");

So then you would write <%: name %>.

If you use JsViews, you can also set the binding character ^ in {^{ - by writing:

$.views.settings.delimiters("<%", "%>", "*");

then using <*%: name %>.

0reactions
BorisMoorecommented, Feb 14, 2016

There is minimal documentation here: http://www.jsviews.com/#tagsyntax

More detail to come when I add docs for settings.delimiters, settings. debugMode() etc.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Setting tag delimiters for JsRender
Sometimes there can be a need to use different delimiters. For example there may be a conflict if the template is being rendered...
Read more >
How to change JsRender template tags? - Stack Overflow
JsRender let's you change the delimiters, like this: $.views.settings.delimiters("<%", "%>");. So then you would write <%: name %> .
Read more >
EJS -- Embedded JavaScript templates
JavaScript code in simple, straightforward scriptlet tags. ... Custom delimiters can be applied on a per-template basis, or globally:.
Read more >
Eta | Eta
Lighweight, powerful, pluggable embedded JS template engine. ... Eta doesn't break with delimiters inside strings and comments. Example: <%= "%>" %> works ...
Read more >
ejs - npm
You'll likely want to use the raw output tag ( <%- ) with your ... Custom delimiters can be applied on a per-template...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found