Closed shmargum closed 8 years ago
It was incompatibility that should be fixed. Thank you!
The Engine options need to be changed from:
Option | Default | Feature |
---|---|---|
escape_html | true | HTML-escape for Ruby script and interpolation. This is false in Haml. |
To:
Option | Default | Feature |
---|---|---|
escape_html | false | HTML-escape for Ruby script and interpolation. |
or not? :question:
Why do you think so? Hamlit aims to be compatible with Haml when the options are the same, not with default Haml's behavior. Since I recommend all people to use escape_html: true
, I intentionally specified that default option.
The behavior is not related to escape_html
option at all.
$ cat in.haml
:plain
<script>
#{'<script>'}
$ haml in.haml
<script>
<script>
$ haml -e in.haml
<script>
<script>
Right, my mistake :+1:
This isn't the biggest deal, but haml doesn't escape interpolated code in the :plain filter This caused some differences when porting I of course can add a .html_safe to the interpolated code, but I figured I'd submit a PR anyway. I know that the defaults for hamlit are to escape code, but since there is a skipped haml test for this I figured I'd submit a PR making the change.
I was not able to get around having to add the html_safe to the interpolated code by adding to my config:
Hamlit::RailsTemplate.set_options html_safe: false