Class: Slimi::Filters::Embedded::TiltEngine Private

Inherits:
Engine
  • Object
show all
Defined in:
lib/slimi/filters/embedded.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Basic tilt engine

Direct Known Subclasses

InterpolateTiltEngine, SassEngine

Instance Method Summary collapse

Methods inherited from Base

#on_slimi_control, #on_slimi_output, #on_slimi_position, #on_slimi_text

Instance Method Details

#on_slimi_embedded(engine, body, _attrs) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



143
144
145
146
147
148
# File 'lib/slimi/filters/embedded.rb', line 143

def on_slimi_embedded(engine, body, _attrs)
  tilt_engine = Tilt[engine] || raise(Temple::FilterError, "Tilt engine #{engine} is not available.")
  tilt_options = options[engine.to_sym] || {}
  tilt_options[:default_encoding] ||= 'utf-8'
  [:multi, tilt_render(tilt_engine, tilt_options, collect_text(body)), collect_newlines(body)]
end