Closed znz closed 7 years ago
Thank you for very helpful issue reporting.
In Sinatra environment, there's very big difference in default config between Hamlit and Haml. https://github.com/k0kubun/hamlit#sinatra
While Haml disables escape_html option by default, Hamlit enables it for security. If you want to disable it, please write: set :haml, { escape_html: false }
If you bundle haml gem, the option is set { escape_html: false }
by default. If you call set :haml, { escape_html: true }
, this issue will happen in haml gem too.
So, the problem here is that you are writing layout that escapes partial view with { escape_html: true }
.
set :haml, { escape_html: false }
Of course, this is recommended.
@@ layout
!!! 5
%html
%head
%title= 'App'
%body
- = yield
+ != yield
@@ debug
%p= "Hello"
I try to use
hamlit
with sinatra, but= yield
in layout escapes HTML.How to use
hamlit
with views of sinatra? When I use inline templates, I get expected results.Example app: https://github.com/znz/sinatra-hamlit-example
How to reproduce:
rackup
http://localhost:9292/
and see<p>Hello</p>
Another result:
ruby app.rb
http://localhost:4567/
and seeHello
without tagsWith
haml
:hamlit
withhaml
in Gemfilebundle update
rackup
http://localhost:9292/
and seeHello
without tags