diff --git a/mustache.js b/mustache.js index 89e3aca..a7d42e0 100644 --- a/mustache.js +++ b/mustache.js @@ -251,7 +251,7 @@ case '#': value = context.lookup(tokenValue); - if (typeof value === 'object') { + if (typeof value === 'object' || typeof value === 'string') { if (isArray(value)) { for (var j = 0, jlen = value.length; j < jlen; ++j) { buffer += renderTokens(token[4], writer, context.push(value[j]), template); diff --git a/test/_files/nested_dot.js b/test/_files/nested_dot.js new file mode 100644 index 0000000..2c22f8e --- /dev/null +++ b/test/_files/nested_dot.js @@ -0,0 +1 @@ +({ name: 'Bruno' }) diff --git a/test/_files/nested_dot.mustache b/test/_files/nested_dot.mustache new file mode 100644 index 0000000..12b0728 --- /dev/null +++ b/test/_files/nested_dot.mustache @@ -0,0 +1 @@ +{{#name}}Hello {{.}}{{/name}} \ No newline at end of file diff --git a/test/_files/nested_dot.txt b/test/_files/nested_dot.txt new file mode 100644 index 0000000..58df047 --- /dev/null +++ b/test/_files/nested_dot.txt @@ -0,0 +1 @@ +Hello Bruno \ No newline at end of file