summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/zorglub/app.rb3
-rw-r--r--lib/zorglub/engines/haml.rb7
2 files changed, 6 insertions, 4 deletions
diff --git a/lib/zorglub/app.rb b/lib/zorglub/app.rb
index 86adf1e..91635ab 100644
--- a/lib/zorglub/app.rb
+++ b/lib/zorglub/app.rb
@@ -18,7 +18,8 @@ module Zorglub
engines: {},
haml_options: {
format: :html5,
- encoding: 'utf-8'
+ encoding: 'utf-8',
+ escape_html: false
},
sass_options: {
syntax: :scss,
diff --git a/lib/zorglub/engines/haml.rb b/lib/zorglub/engines/haml.rb
index b602773..0031eec 100644
--- a/lib/zorglub/engines/haml.rb
+++ b/lib/zorglub/engines/haml.rb
@@ -5,12 +5,13 @@ module Zorglub
module Engines
module Haml
def self.proc(path, obj)
- haml = ::Haml::Template.new(path)
if obj.app.opt(:engines_cache_enabled)
key = path.sub obj.app.opt(:root), ''
- obj.app.engines_cache[key] ||= haml
+ haml = obj.app.engines_cache[key] || ::Haml::Template.new(obj.app.opt(:haml_options)) { ::File.read(path) }
+ else
+ haml = ::Haml::Template.new(obj.app.opt(:haml_options)) { ::File.read(path) }
end
- html = haml.render(obj, obj.app.opt(:haml_options))
+ html = haml.render(obj)
[html, 'text/html']
end
end