Class: Faml::FilterCompilers::Escaped
- Includes:
- Temple::Utils
- Defined in:
- lib/faml/filter_compilers/escaped.rb
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#compile(ast) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/faml/filter_compilers/escaped.rb', line 9 def compile(ast) temple = [:multi, [:newline]] compile_texts(temple, ast.lineno, ast.texts) temple << [:static, "\n"] escape_code = Temple::Filters::Escapable.new(use_html_safe: false).instance_variable_get(:@escape_code) sym = unique_name [:multi, [:capture, sym, temple], [:dynamic, escape_code % sym], ] end |