You wrote:
= hb 'if content.condition1' do
= hb 'if content.condition2' do
%p Some paragraph
= hb 'else'
%p another paragraph
= hb 'else'
%p third paragraph
Correct code:
= hb 'if content.condition1' do
= hb 'if content.condition2' do
%p Some paragraph
= hb 'else'
%p another paragraph
= hb 'else'
%p third paragraph
The reason for this is actually a haml syntax issue, not a hamlbars one. You cannot nest under a ruby statement unless you're passing in a block. Since {{else}}
is not a handlebars block statement you don't pass in a block. Haml would help a lot if it threw the a similar error to the one it throws when you try and nest under plain text.
I like the proposed syntax better. It seems much more natural.