Skip to content

Commit

Permalink
Merge pull request rooseveltframework#422 from kethinov/0.5.5
Browse files Browse the repository at this point in the history
0.5.5
  • Loading branch information
kethinov authored Sep 29, 2020
2 parents a97180c + 96fb494 commit 2631a33
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"url": "https://github.com/rooseveltframework/teddy/graphs/contributors"
}
],
"version": "0.5.4",
"version": "0.5.5",
"files": [
"dist/teddy.js"
],
Expand Down
5 changes: 5 additions & 0 deletions test/misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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), '<p>0</p>')
done()
})

// wontfix: https://github.com/rooseveltframework/teddy/issues/357
it.skip('should not render excessive whitespace in a <textarea> as a result of teddy tag indententation / formatting (misc/excessiveWhitespace.html)', function (done) {
assert.equal(teddy.render('misc/excessiveWhitespace.html', model), '<textarea>Some text here</textarea>')
Expand Down
1 change: 1 addition & 0 deletions test/models/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ function makeModel () {
pageContent: '<body>hello</body>',
undefinedVar: undefined,
emptyString: '',
zero: 0,
definedParent: { undefinedMember: undefined, emptyMember: '' },
camelLetters: ['a', 'b', 'c'],
missingLetter: ['a', undefined, 'c'],
Expand Down
5 changes: 5 additions & 0 deletions test/templates/misc/zero.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{!
should render {zero} as 0
!}

<p>{zero}</p>
2 changes: 1 addition & 1 deletion utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2631a33

Please sign in to comment.