Skip to content

Handle significant whitespace before a blocks body #15692

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

Blacksmoke16
Copy link
Member

Follow up to #15568 to handle the case of significant whitespace before a block's body.

Previously code like:

{%
  ({"a" => "b"} of Nil => Nil).each do |k, v|
    # stuff and things
    k + v

    # foo bar

    k + v
  end
%}

Would always be stringified as:

{%
  ({"a" => "b"} of Nil => Nil).each do |k, v|
    k + v



    k + v
  end
%}

But now results in:

{%
  ({"a" => "b"} of Nil => Nil).each do |k, v|
  
    k + v
  
  
  
    k + v
  end
%}

@straight-shoota straight-shoota added this to the 1.17.0 milestone Apr 22, 2025
@straight-shoota straight-shoota merged commit ebc1cae into crystal-lang:master Apr 25, 2025
34 checks passed
@Blacksmoke16 Blacksmoke16 deleted the sig-whitespace-before-block-body branch April 25, 2025 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants