Class: Liquid::ParseEnvironment::RawFallbackTemplate
- Inherits:
-
Object
- Object
- Liquid::ParseEnvironment::RawFallbackTemplate
- Defined in:
- app/lib/liquid/parse_environment.rb
Overview
Returned when Liquid parsing fails due to an unknown tag or other
syntax error. Strips unparseable {%…%} block tags so they don't
leak into rendered HTML, while preserving all other content.
Instance Method Summary collapse
-
#initialize(content) ⇒ RawFallbackTemplate
constructor
A new instance of RawFallbackTemplate.
- #render(_context = {}) ⇒ Object
Constructor Details
#initialize(content) ⇒ RawFallbackTemplate
Returns a new instance of RawFallbackTemplate.
58 59 60 |
# File 'app/lib/liquid/parse_environment.rb', line 58 def initialize(content) @content = content end |
Instance Method Details
#render(_context = {}) ⇒ Object
62 63 64 |
# File 'app/lib/liquid/parse_environment.rb', line 62 def render(_context = {}) @content.gsub(/\{%.*?%\}/m, '') end |