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:
parent
601b17bb95
commit
a2b69e3cbe
2 changed files with 7 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -27,6 +27,9 @@ describe Hamlit::RailsTemplate do
|
|||
assert_equal %Q|<a href='<script>alert("a");</script>'></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
|
||||
|
|
Loading…
Reference in a new issue