You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-5Lines changed: 11 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -117,9 +117,10 @@ Following is an [rtype](https://git.io/rtype) signature of the most commonly use
117
117
118
118
```js
119
119
Mustache.render(
120
-
template :String,
121
-
view :Object,
122
-
partials?:Object,
120
+
template :String,
121
+
view :Object,
122
+
partials?:Object,
123
+
tags = ['{{', '}}'] : Tags,
123
124
) =>String
124
125
125
126
Mustache.parse(
@@ -181,7 +182,7 @@ function loadUser() {
181
182
182
183
The most basic tag type is a simple variable. A `{{name}}` tag renders the value of the `name` key in the current context. If there is no such key, nothing is rendered.
183
184
184
-
All variables are HTML-escaped by default. If you want to render unescaped HTML, use the triple mustache: `{{{name}}}`. You can also use `&` to unescape a variable.
185
+
All variables are HTML-escaped by default. If you want to render unescaped HTML, use the triple mustache: `{{{name}}}`. You can also use `&` to unescape a variable.
185
186
186
187
If you'd like to change HTML-escaping behavior globally (for example, to template non-HTML formats), you can override Mustache's escape function. For example, to disable all escaping: `Mustache.escape=function(text) {return text;};`.
187
188
@@ -504,12 +505,17 @@ Custom delimiters can be used in place of `{{` and `}}` by setting the new value
504
505
505
506
#### Setting in JavaScript
506
507
507
-
The `Mustache.tags` property holds an array consisting of the opening and closing tag values. Set custom values by setting this property.
508
+
The `Mustache.tags` property holds an array consisting of the opening and closing tag values. Set custom values by passing a new array of tags to `render()`, which gets honored over the default values, or by overriding the `Mustache.tags` property itself:
0 commit comments