Open nikkilocke opened 10 years ago
I raised this previously https://github.com/jehugaleahsa/mustache-sharp/issues/9.
As a workaround, you can use {{#if ...}}{{#else}}Content{{/if}}}
I'll probably try to fix it next time I look at the code.
Nikki Locke, Trumphurst Ltd. PC & Unix consultancy & programming http://www.trumphurst.com/
Now pushed a fix for this
@nikkilocke, I don't see the updates for {{#unless}} in this branch nor in yours. Is it intended to be merged into this branch?
Hi Bryant,
That's probably because I found it too difficult, so gave up and used the workround instead!
Regards,
Nikki
Bryant Gallardo wrote:
@nikkilocke, I don't see the updates for {{#unless}} in this branch nor in yours. Is it intended to be merged into this branch?
— Reply to this email directly or view it on GitHub.
Nikki Locke, Trumphurst Ltd. PC & Unix consultancy & programming http://www.trumphurst.com/
@nikkilocke @jehugaleahsa I went ahead and added the {{#unless}} tag implementation for this in my fork. Also added corresponding unit tests. https://github.com/bryant988/mustache-sharp
After doing this, I wonder if it would be useful to have the #elif opposite equivalent also (#elunless)? I might add that at another time.
Hi Bryant,
Sorry - I'm getting old, and my memory is not what it was :-)
Next time I have some spare time, I will look out the change and bring it up to date.
I will also do the array index change again.
Can you explain exactly how I am supposed to do this (I am not that familiar with github)?
If I clone your repo, does it overwrite the copy I have already cloned? In which case, won't the previous work be lost?
Regards,
Nikki
Nikki Locke, Trumphurst Ltd. PC & Unix consultancy & programming http://www.trumphurst.com/
Hi again, Bryant,
I have searched the repository, and I can't find any record of an unless tag. Sorry.
I do vaguely remember being stymied because I did not know how to handle #unless ... else ... /unless, ans else seemed to be inextricably linked to #if.
Regards,
Nikki
Nikki Locke, Trumphurst Ltd. PC & Unix consultancy & programming http://www.trumphurst.com/
@nikkilocke
I have searched the repository, and I can't find any record of an unless tag. Sorry.
{{#unless}}
tag commit details here:
https://github.com/bryant988/mustache-sharp/commit/60e40fa851ef9d6830757c6de51249e822b17772I do vaguely remember being stymied because I did not know how to handle #unless ... else ... /unless, and else seemed to be inextricably linked to #if.
{{#elif}}
and {{#else}}
statements within the {{#unless}}
statement, but they do not act like logical NOTs.
I thought about creating a {{#elunless}}
(opposite of {{#elif}}
) which would be equivalent to an else if(!condition)
If I clone your repo, does it overwrite the copy I have already cloned? In which case, won't the previous work be lost
Sorry, I was misunderstanding - I thought you were talking about some change I had made. I'll shut up now!
Nikki Locke, Trumphurst Ltd. PC & Unix consultancy & programming http://www.trumphurst.com/
http://handlebarsjs.com/ documents the #unless helper (inverse of #if) but mustache-csharp does not appear to support it.