60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
# File 'lib/ezml/filters.rb', line 60
def compile(compiler, text)
filter = self
compiler.instance_eval do
if contains_interpolation?(text)
return if options[:suppress_eval]
text = unescape_interpolation(text, options[:escape_html]).gsub(/(\\+)n/) do |s|
escapes = $1.size
next s if escapes % 2 == 0
"#{'\\' * (escapes - 1)}\n"
end
text = %[\n#{text.sub(/\n"\Z/, "\\n\"")}]
push_script <<RUBY.rstrip, :escape_html => false
find_and_preserve(#{filter.inspect}.render_with_options(#{text}, _ezmlout.options))
RUBY
return
end
rendered = EZML::Helpers::find_and_preserve(filter.render_with_options(text.to_s, compiler.options), compiler.options[:preserve])
push_text("#{rendered.rstrip}\n")
end
end
|