wbond / pybars3

Handlebars.js template support for Python 3 and 2
GNU Lesser General Public License v3.0
179 stars 46 forks source link

Unless should support {{else}} #46

Closed ericharding closed 2 years ago

ericharding commented 7 years ago

Before this change if 'test' was true nothing would be rendered in the template (and no error would be raised). This makes the else show up as expected. I believe this is supported by the original handlebars but I haven't tested.

{{#unless test}}
A
{{else}}
B
{{/unless}}
codecov[bot] commented 7 years ago

Codecov Report

Merging #46 into master will decrease coverage by 0.2%. The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #46      +/-   ##
==========================================
- Coverage   91.07%   90.86%   -0.21%     
==========================================
  Files           2        2              
  Lines         437      438       +1     
  Branches       85       85              
==========================================
  Hits          398      398              
- Misses         24       25       +1     
  Partials       15       15
Impacted Files Coverage Δ
pybars/_compiler.py 90.74% <0%> (-0.22%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 38dc8b7...9fb733f. Read the comment docs.

wbond commented 7 years ago

Can you add some tests for this change?

wbond commented 2 years ago

This was added with a test in #70