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.
37 38 39 |
# File 'app/lib/liquid/parse_environment.rb', line 37 def initialize(content) @content = content end |
Instance Method Details
#render(_context = {}) ⇒ Object
41 42 43 |
# File 'app/lib/liquid/parse_environment.rb', line 41 def render(_context = {}) @content.gsub(/\{%.*?%\}/m, '') end |