crystal-lang / crystal

The Crystal Programming Language
https://crystal-lang.org
Apache License 2.0
19.2k stars 1.61k forks source link

ECR escape sequences do not work with `-` #14734

Closed HertzDevil closed 1 week ago

HertzDevil commented 1 week ago

The following ECR template: (notice the leading space)

  <%-% 1 + 2 %>

renders:

  <% 1 + 2 %>

The leading - is now gone, and also the leading indentation is not removed (but maybe this is intended behavior).

Meanwhile, the following:

<%% 1 + 2 -%>
3

renders:

<% 1 + 2 -%
3

Now the trailing > is gone, and the newline after that is not removed (again this could be intended behavior).