lib/hamlit/compiler/script_compiler.rb in hamlit-2.1.0 vs lib/hamlit/compiler/script_compiler.rb in hamlit-2.1.1
- old
+ new
@@ -26,16 +26,16 @@
def string_compile(node)
temple = [:multi]
StringInterpolation.compile(node.value[:text]).each do |type, value|
case type
when :static
- value = Temple::Utils.escape_html(value) if node.value[:escape_html]
+ value = Hamlit::Utils.escape_html(value) if node.value[:escape_html]
temple << [:static, value]
when :dynamic
if Hamlit::StaticAnalyzer.static?(value)
value = eval(value).to_s
- value = Temple::Utils.escape_html(value) if node.value[:escape_html] || node.value[:escape_interpolation]
+ value = Hamlit::Utils.escape_html(value) if node.value[:escape_html] || node.value[:escape_interpolation]
temple << [:static, value]
else
temple << [:escape, node.value[:escape_html] || node.value[:escape_interpolation], [:dynamic, value]]
end
end
@@ -44,10 +44,10 @@
end
def static_compile(node)
str = eval("(#{node.value[:text]}).to_s")
if node.value[:escape_html]
- str = Temple::Utils.escape_html(str)
+ str = Hamlit::Utils.escape_html(str)
elsif node.value[:preserve]
str = ::Hamlit::HamlHelpers.find_and_preserve(str, %w(textarea pre code))
end
[:multi, [:static, str], [:newline]]
end