pmcelhaney/Mustache.cfc — Issue #7: Can't get inverted sections to work.
Author: SirRawlins
Created: 2012-03-05 13:53:12+00:00
State: open

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