1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

Explicitly set use_html_safe

This commit is contained in:
Takashi Kokubun 2015-11-23 14:08:16 +09:00
parent 601b17bb95
commit a2b69e3cbe
2 changed files with 7 additions and 4 deletions

View file

@ -7,10 +7,10 @@ require 'hamlit/parser/haml_util'
module Hamlit
RailsTemplate = Temple::Templates::Rails.create(
Hamlit::Engine,
generator: Temple::Generators::RailsOutputBuffer,
register_as: :haml,
escape_html: true,
streaming: true,
generator: Temple::Generators::RailsOutputBuffer,
register_as: :haml,
use_html_safe: true,
streaming: true,
)
# https://github.com/haml/haml/blob/4.0.7/lib/haml/template.rb

View file

@ -27,6 +27,9 @@ describe Hamlit::RailsTemplate do
assert_equal %Q|<a href='&lt;script&gt;alert(&quot;a&quot;);&lt;/script&gt;'></a>\n|, render(<<-HAML.unindent)
%a{ href: '<script>alert("a");</script>' }
HAML
assert_equal %Q|<a href='<script>'></a>\n|, render(<<-HAML.unindent)
%a{ href: '<script>'.html_safe }
HAML
end
specify 'boolean attributes' do