code.conditionals.js
1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
function template(locals) {
var pug_html = "", pug_mixins = {}, pug_interp;
if (true) {
pug_html = pug_html + "<p>foo</p>";
} else {
pug_html = pug_html + "<p>bar</p>";
}
if (true) {
{
pug_html = pug_html + "<p>foo</p>";
}
} else {
{
pug_html = pug_html + "<p>bar</p>";
}
}
if (true) {
pug_html = pug_html + "<p>foo</p><p>bar</p><p>baz</p>";
} else {
pug_html = pug_html + "<p>bar</p>";
}
if (!true) {
pug_html = pug_html + "<p>foo</p>";
} else {
pug_html = pug_html + "<p>bar</p>";
}
if ("nested") {
if ("works") {
pug_html = pug_html + "<p>yay</p>";
}
}
if (false) {} else {
pug_html = pug_html + '<div class="bar"></div>';
}
if (true) {
pug_html = pug_html + '<div class="bar"></div>';
}
pug_html = pug_html + '<div class="bing"></div>';
if (false) {
pug_html = pug_html + '<div class="bing"></div>';
} else if (false) {
pug_html = pug_html + '<div class="bar"></div>';
} else {
pug_html = pug_html + '<div class="foo"></div>';
}
return pug_html;
}