olado / doT

The fastest + concise javascript template engine for nodejs and browsers. Partials, custom delimiters and more.
Other
5.01k stars 1.02k forks source link

Fix {{!value}} out when the value is number 0 #272

Closed keel closed 6 years ago

keel commented 6 years ago

{{!value}} out '' when the value is number 0 or boolean false, but{{=value}} is right, so I think this should be fixed.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.03%) to 98.148% when pulling d87508b8ff27aaf1daed2ed84886f4392fae1b96 on keel:v2.0.0 into 0ddc0974648668ea78871ecd918a5f10ece5852c on olado:v2.0.0.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.03%) to 98.148% when pulling d87508b8ff27aaf1daed2ed84886f4392fae1b96 on keel:v2.0.0 into 0ddc0974648668ea78871ecd918a5f10ece5852c on olado:v2.0.0.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.03%) to 98.148% when pulling d87508b8ff27aaf1daed2ed84886f4392fae1b96 on keel:v2.0.0 into 0ddc0974648668ea78871ecd918a5f10ece5852c on olado:v2.0.0.

keel commented 6 years ago

@epoberezkin I think templet engine does not expects the input value is always string, just like jsp, <%=new Integer(0) %> it will out "0" not "" , and {{=does the right output ,it will be '0', {{! should be the same, and also there're similar issues before, like #170 , #178, #183 . So I think it should be fixed.

The tests failed last time because the travis itself, anyway I send a new PR in v2.0.0.