diff --git a/CHANGELOG.md b/CHANGELOG.md index 92dc762f..c91d0c21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ - Put your changes here... +## 0.5.5 + +- Closed https://github.com/rooseveltframework/teddy/issues/421 + ## 0.5.4 - Closed https://github.com/rooseveltframework/teddy/issues/412 diff --git a/package-lock.json b/package-lock.json index a226ec7f..6511604a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "teddy", - "version": "0.5.4", + "version": "0.5.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 38ba4b07..6e706e0e 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "url": "https://github.com/rooseveltframework/teddy/graphs/contributors" } ], - "version": "0.5.4", + "version": "0.5.5", "files": [ "dist/teddy.js" ], diff --git a/test/misc.js b/test/misc.js index 9e2ff38b..d1389d7a 100644 --- a/test/misc.js +++ b/test/misc.js @@ -253,6 +253,11 @@ describe('Misc', function () { done() }) + it('should render {zero} as 0 (misc/zero.html)', function (done) { + assert.equalIgnoreSpaces(teddy.render('misc/zero.html', model), '

0

') + done() + }) + // wontfix: https://github.com/rooseveltframework/teddy/issues/357 it.skip('should not render excessive whitespace in a ') diff --git a/test/models/model.js b/test/models/model.js index ff1a4bc3..f3643f1b 100644 --- a/test/models/model.js +++ b/test/models/model.js @@ -10,6 +10,7 @@ function makeModel () { pageContent: 'hello', undefinedVar: undefined, emptyString: '', + zero: 0, definedParent: { undefinedMember: undefined, emptyMember: '' }, camelLetters: ['a', 'b', 'c'], missingLetter: ['a', undefined, 'c'], diff --git a/test/templates/misc/zero.html b/test/templates/misc/zero.html new file mode 100644 index 00000000..16201069 --- /dev/null +++ b/test/templates/misc/zero.html @@ -0,0 +1,5 @@ +{! + should render {zero} as 0 +!} + +

{zero}

diff --git a/utils.js b/utils.js index 6d7063d2..44f96508 100644 --- a/utils.js +++ b/utils.js @@ -60,7 +60,7 @@ function getTeddyVal (name, model, escapeOverride) { } } - if (tempValue || tempValue === '' || tempValue === false) { + if (tempValue || tempValue === 0 || tempValue === '' || tempValue === false) { if (noParse && noSuppress) { // something|p|s return noParseFlag(tempValue) } else if (noSuppress) { // something|s