Module: Spree::Core::Emails::EscapedOutput

Defined in:
lib/spree/core/emails/escaped_output.rb

Overview

HTML-escapes what a Liquid email template prints, unless the value was marked | raw. Applied where output is written rather than through Liquid's global filter, which {% assign %} also runs through — that would escape a value once when assigned and again when printed, and turn assigned numbers and lists into strings.

Switched on by the escape_output register, which Liquid hands down to every partial, so any other Liquid the host app runs is untouched.

Defined Under Namespace

Modules: Variable Classes: Capture, Cycle

Class Method Summary collapse

Class Method Details

.active?(context) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/spree/core/emails/escaped_output.rb', line 13

def self.active?(context)
  context.registers[:escape_output]
end