If a leading/trailing space is present inside the opening/closing expression of a an if-block helper, a Parselet::ParseFailed error will be raised during compilation of the template when using ruby-handlebars v0.4.0 and parselet v1.8.2.
Handlebars::Handlebars.new.compile(<<~TEMPLATE.strip)
{{ #if foo}}
Foo
{{/if}}
TEMPLATE
Handlebars::Handlebars.new.compile(<<~TEMPLATE.strip)
{{#if foo}}
Foo
{{/if }}
TEMPLATE
# Parslet::ParseFailed: Extra input after last repetition at line 1 char 1.
# from /usr/local/bundle/gems/parslet-1.8.2/lib/parslet/cause.rb:70:in `raise'
This seems to deviate from how handlebars-js handles templates in that trailing or leading spaces don't seem to adversely affect the canonical implementation. I'm aware that this gem isn't intended as a complete implementation of handlebars. Would you consider this an intentional design decision or would it be sensible to add space? to the parslet logic in parser.rb?