Skip to content

Instantly share code, notes, and snippets.

@dball
Created October 1, 2010 19:08
Show Gist options
  • Save dball/606677 to your computer and use it in GitHub Desktop.
Save dball/606677 to your computer and use it in GitHub Desktop.
module Liquid
class Variable
def render_with_html_escape(context)
output = render_without_html_escape(context)
if context.registers[:html_escape] && !output.html_safe?
ERB::Util::html_escape(output)
else
output
end
end
alias_method_chain :render, :html_escape
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment