Skip to content

Whitespace control isn't supported #37

@yorickpeterse

Description

@yorickpeterse

Handlebars allows you to control the whitespace as described in https://handlebarsjs.com/guide/expressions.html#whitespace-control. This however isn't supported by this Gem. For example, this template:

{{#each numbers as |number| ~}}
Number: {{number}}
{{/each}}

Will produce an error along the lines of:

Traceback (most recent call last):
        4: from /tmp/bench.rb:24:in `<main>'
        3: from /home/yorickpeterse/.gem/ruby/2.7.2/gems/ruby-handlebars-0.4.0/lib/ruby-handlebars.rb:22:in `compile'
        2: from /home/yorickpeterse/.gem/ruby/2.7.2/gems/ruby-handlebars-0.4.0/lib/ruby-handlebars.rb:63:in `template_to_ast'
        1: from /home/yorickpeterse/.gem/ruby/2.7.2/gems/parslet-1.8.2/lib/parslet/atoms/base.rb:49:in `parse'
/home/yorickpeterse/.gem/ruby/2.7.2/gems/parslet-1.8.2/lib/parslet/cause.rb:70:in `raise': Extra input after last repetition at line 1 char 1. (Parslet::ParseFailed)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions