Skip to content

Incorrect Formatting for Multiline Attributes #35

Closed
@Petercopter

Description

@Petercopter

Given this code:

%ul.nav.nav-tabs.mb-4
  %li.nav-item
    %button.nav-link.active{data: { bs_toggle: 'tab', bs_target: '#file' }, type: 'button' }
      File
  %li.nav-item
    %button.nav-link{ data: { bs_toggle: 'tab', bs_target: '#video' }, type: 'button' }
      Video

The first time I save (in VSCode, format on save) I get this, which is expected:

%ul.nav.nav-tabs.mb-4
  %li.nav-item
    %button.nav-link.active{
      data: { bs_toggle: 'tab', bs_target: '#file' },
      type: 'button'
    }
      File
  %li.nav-item
    %button.nav-link{
      data: { bs_toggle: 'tab', bs_target: '#video' },
      type: 'button'
    }
      Video

But I save again, and it turns into this, which is unexpected:

%ul.nav.nav-tabs.mb-4
  %li.nav-item
    %button.nav-link.active{
data: { bs_toggle: 'tab', bs_target: '#file' },
type: 'button'
}
      File
  %li.nav-item
    %button.nav-link{
data: { bs_toggle: 'tab', bs_target: '#video' },
type: 'button'
}
      Video

So it appears the syntax_tree formatting is incorrect and not idempotent (vocabulary word!) in this case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions