Skip to content

Commit

Permalink
remove nunjucks
Browse files Browse the repository at this point in the history
  • Loading branch information
aui committed May 10, 2017
1 parent 34b29bb commit 7db9222
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 18 deletions.
25 changes: 11 additions & 14 deletions example/web-test-speed/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<script src="js/handlebars.js"></script>
<script src="js/mustache.min.js"></script>
<script src="js/pug.min.js"></script>
<script src="js/nunjucks.min.js"></script>
<script src="js/swig.min.js"></script>

<script>
var config = {
Expand Down Expand Up @@ -159,14 +159,14 @@
},

{
name: 'nunjucks',
name: 'swig',
tester: function () {
var id = config.escape ? 'nunjucks' : 'nunjucks-raw';
var id = config.escape ? 'swig' : 'swig-raw';
var source = document.getElementById(id).innerHTML;
var fn = nunjucks.compile(source);
var fn = swig.compile(source);
var html = '';
for (var i = 0; i < config.calls; i++) {
html = fn.render(data);
html = fn(data);
}
return html;
}
Expand Down Expand Up @@ -403,19 +403,19 @@
</ul>
</script>

<!--nunjucks -->
<script id="nunjucks" type="text/tmpl">
<!--swig -->
<script id="swig" type="text/tmpl">
<ul>
{% for value in list %}
{% for key, value in list %}
<li>User: {{value.user}} / Web Site: {{value.site}}</li>
{% endfor %}
</ul>
</script>

<script id="nunjucks-raw" type="text/tmpl">
<script id="swig-raw" type="text/tmpl">
<ul>
{% for value in list %}
<li>User: {{value.user | safe}} / Web Site: {{value.site | safe}}</li>
{% for key, value in list %}
{% autoescape false %}<li>User: {{value.user}} / Web Site: {{value.site}}</li>{% endautoescape %}
{% endfor %}
</ul>
</script>
Expand All @@ -427,9 +427,6 @@
line-height: 1.5;
word-wrap: break-word;
}
#app h1 {
text-align: center;
}
#app .header {
padding: 10px 20px;
background: #eee;
Expand Down
Loading

0 comments on commit 7db9222

Please sign in to comment.