Skip to content

Ampersand produces </HIML_ERB_TAG> #7

@sakuro

Description

@sakuro

Using safe navigation operator (&.), Himl 0.1.1 produces unexpected </HIML_ERB_TAG>.

without &.

require 'himl'

template = '<%= @x.nil? ? nil : @x.to_f %>'
@x = 1r/3

parser = Himl::Parser.new
puts parser.call(template).to_erb

produces

<%= @x.nil? ? '' : @x.to_f %>

with &.

require 'himl'

template = '<%= @x&.to_f %>'
@x = 1r/3

parser = Himl::Parser.new
puts parser.call(template).to_erb

produces

</HIML_ERB_TAG>
<%= @x&.to_f %>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions