Skip to content

Instantly share code, notes, and snippets.

@hellojinjie
Created December 17, 2017 10:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hellojinjie/76626bfbb5ddf8950c69a3b324838e04 to your computer and use it in GitHub Desktop.
Save hellojinjie/76626bfbb5ddf8950c69a3b324838e04 to your computer and use it in GitHub Desktop.
_.templateSettings = {
interpolate : /\{\{(.+?)\}\}/g, // print value: {{ value_name }}
evaluate : /\{%([\s\S]+?)%\}/g, // excute code: {% code_to_execute %}
escape : /\{%-([\s\S]+?)%\}/g // excape HTML: {%- <script> %} prints &lt;script&gt;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment