Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix issue with nulls. Resolves issue #28

  • Loading branch information...
commit c22261d8b634489f8f8fa2058e3ada9d1320686b 1 parent d46d9f4
@raycmorgan authored
View
6 lib/mu/renderer.js
@@ -88,7 +88,11 @@ function _render(tokens, context, partials, stream, callback) {
}
function s(val) {
- return typeof val === 'undefined' ? '' : val.toString();
+ if (val === null || typeof val === 'undefined') {
+ return '';
+ } else {
+ return val.toString();
+ }
}
function escape(string) {
View
3  test/examples/simple.html
@@ -2,4 +2,5 @@
You have just won ${{value}}!
{{#in_ca}}
Well, ${{ taxed_value }}, after taxes.
-{{/in_ca}}
+{{/in_ca}}
+Love, {{owner}}
View
3  test/examples/simple.js
@@ -4,5 +4,6 @@
taxed_value: function () {
return this.value - (this.value * 0.4);
},
- in_ca: true
+ in_ca: true,
+ owner: null
}
View
2  test/examples/simple.txt
@@ -2,3 +2,5 @@ Hello Chris
You have just won $10000!
Well, $6000, after taxes.
+
+Love,
Please sign in to comment.
Something went wrong with that request. Please try again.