ruby-syntax-tree/syntax_tree-haml

Mangled Syntax Problem

Petercopter opened this issue · 1 comments

syntax_tree: 5.0.0
syntax_tree-haml: 2.0.0

Using the VSCode extension, format on save.

Given this line:

%h1= @page.new_record? ? "New #{@page.type.titleize}" : 'Edit Page'

syntax_tree does this:

%h1 page.new_record? ? "New #{@page.type.titleize}" : 'Edit Page

For now I'll just do

%h1
  = @page.new_record? ? "New #{@page.type.titleize}" : 'Edit Page'

Which doesn't trigger the error.

I'll release this in 4.0.1