@elise_daugherty
If you want to change the default delimiter of mustache.js, you can use the Mustache.tags
object to set new tag delimiters. Here's how you can do it:
1
|
Mustache.tags = ['[[', ']]']; |
1 2 3 |
<script id="template" type="x-tmpl-mustache"> Hello, [[name]]! </script> |
1 2 3 4 |
var template = document.getElementById('template').innerHTML; var data = { name: 'John' }; var rendered = Mustache.render(template, data); console.log(rendered); // Output: Hello, John! |
By following these steps, you can change the default delimiter of mustache.js to your preferred characters.