Created
June 17, 2014 20:13
-
-
Save arbalest/765118a1e2af296ff8bc to your computer and use it in GitHub Desktop.
Underscore Templates: Handlebar-Style Configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* templateSettings object to configure Underscore's template engine to use Mustache-like curly-brace syntax. | |
*/ | |
_.templateSettings = { | |
evaluate: /\{\{#([\s\S]+?)\}\}/g, // {{# console.log("pikachu!") }} | |
interpolate: /\{\{[^#\{]([\s\S]+?)[^\}]\}\}/g, // {{ title }} | |
escape: /\{\{\{([\s\S]+?)\}\}\}/g, // {{{ title }}} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment