Mustache.cfc icon indicating copy to clipboard operation
Mustache.cfc copied to clipboard

Can't get inverted sections to work.

Open SirRawlins opened this issue 12 years ago • 2 comments

Hi,

I'm trying to get inverted sections working, but for some reason the content within the inverted section is always rendered, even if the key exists.

e.g.

{{#replacement}}

Thank you for your replacement order #{{order_number}}. Our delivery department will be in contact with you as soon as your replacement has been made, to arrange for its delivery and the collection of your returned products from order.

{{/replacement}}

{{^replacement}}

Thank you for your recent order. The attached order is what we are going to make for you. Please can you spend a minute to check it, to make sure this is exactly what you want.


{{/replacement}}

The first paragraph is rendered only when 'replacement' is a key within the collection. I would expect the second paragraph to only render if the key does not exist, however, it rendered even when it does.

Am I doing something wrong here? or is there a bug?

I downloaded the latest .zip of the project this morning to test with and it still seems to have this problem.

Thanks.

Robert

SirRawlins avatar Mar 05 '12 13:03 SirRawlins

Did anyone resolve this issue yet?

jenzener avatar Feb 25 '13 06:02 jenzener

I think so. Get the latest version at @rip747's branch. https://github.com/rip747/Mustache.cfc

pmcelhaney avatar Feb 25 '13 12:02 pmcelhaney