@@ -49,19 +49,19 @@ contains the data and code needed to render the template.
49
49
50
50
A [ mustache] ( http://mustache.github.com/ ) template is a string that contains
51
51
any number of mustache tags. Tags are indicated by the double mustaches that
52
- surround them. * {{person}}* is a tag, as is * {{#person}}* . In both examples we
53
- refer to * person* as the tag's key.
52
+ surround them. ` {{person}} ` is a tag, as is ` {{#person}} ` . In both examples we
53
+ refer to ` person ` as the tag's key.
54
54
55
55
There are several types of tags available in mustache.js.
56
56
57
57
### Variables
58
58
59
- The most basic tag type is a simple variable. A * {{name}}* tag renders the value
60
- of the * name* key in the current context. If there is no such key, nothing is
59
+ The most basic tag type is a simple variable. A ` {{name}} ` tag renders the value
60
+ of the ` name ` key in the current context. If there is no such key, nothing is
61
61
rendered.
62
62
63
63
All variables are HTML-escaped by default. If you want to render unescaped HTML,
64
- use the triple mustache: * {{{name}}}* . You can also use * & * to unescape a
64
+ use the triple mustache: ` {{{name}}} ` . You can also use ` & ` to unescape a
65
65
variable.
66
66
67
67
Template:
@@ -115,15 +115,15 @@ Output:
115
115
Sections render blocks of text one or more times, depending on the value of the
116
116
key in the current context.
117
117
118
- A section begins with a pound and ends with a slash. That is, * {{#person}}*
119
- begins a * person* section, while * {{/person}}* ends it. The text between the two
118
+ A section begins with a pound and ends with a slash. That is, ` {{#person}} `
119
+ begins a ` person ` section, while ` {{/person}} ` ends it. The text between the two
120
120
tags is referred to as that section's "block".
121
121
122
122
The behavior of the section is determined by the value of the key.
123
123
124
124
#### False Values or Empty Lists
125
125
126
- If the * person* key exists and has a value of ` null ` , ` undefined ` , or ` false ` ,
126
+ If the ` person ` key exists and has a value of ` null ` , ` undefined ` , or ` false ` ,
127
127
or is an empty list, the block will not be rendered.
128
128
129
129
Template:
@@ -145,7 +145,7 @@ Output:
145
145
146
146
#### Non-Empty Lists
147
147
148
- If the * person* key exists and is not ` null ` , ` undefined ` , or ` false ` , and is
148
+ If the ` person ` key exists and is not ` null ` , ` undefined ` , or ` false ` , and is
149
149
not an empty list the block will be rendered one or more times.
150
150
151
151
When the value is a list, the block is rendered once for each item in the list.
@@ -298,7 +298,7 @@ They also inherit the calling context. Whereas in ERB you may have this:
298
298
299
299
Mustache requires only this:
300
300
301
- {{> next_more}}
301
+ {{> next_more}}
302
302
303
303
Why? Because the ` next_more.mustache ` file will inherit the ` size ` and ` start `
304
304
variables from the calling context. In this way you may want to think of
0 commit comments