Class: Liquid2::RawTag
Overview
The standard raw tag.
Instance Attribute Summary
Attributes inherited from Node
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(token, text) ⇒ RawTag
constructor
A new instance of RawTag.
- #render(_context, buffer) ⇒ Object
Methods inherited from Tag
Methods inherited from Node
#block_scope, #children, #expressions, #partial_scope, #render_with_disabled_tag_check, #template_scope
Constructor Details
#initialize(token, text) ⇒ RawTag
Returns a new instance of RawTag.
21 22 23 24 25 |
# File 'lib/liquid2/nodes/tags/raw.rb', line 21 def initialize(token, text) super(token) @text = text @blank = false end |
Class Method Details
.parse(token, parser) ⇒ RawTag
10 11 12 13 14 15 16 17 18 |
# File 'lib/liquid2/nodes/tags/raw.rb', line 10 def self.parse(token, parser) parser.carry_whitespace_control parser.eat(:token_tag_end) # TODO: apply whitespace control to raw text? # Shopify/liquid does not apply whitespace control to raw content. raw = parser.eat(:token_raw) parser.eat_empty_tag("endraw") new(token, raw[1] || raise) end |
Instance Method Details
#render(_context, buffer) ⇒ Object
27 28 29 |
# File 'lib/liquid2/nodes/tags/raw.rb', line 27 def render(_context, buffer) buffer << @text end |