Class: Liquid::Doc
Constant Summary collapse
- NO_UNEXPECTED_ARGS =
/\A\s*\z/
Constants inherited from Block
Instance Attribute Summary
Attributes inherited from Tag
#line_number, #nodelist, #parse_context, #tag_name
Instance Method Summary collapse
- #blank? ⇒ Boolean
-
#initialize(tag_name, markup, parse_context) ⇒ Doc
constructor
A new instance of Doc.
- #parse(tokens) ⇒ Object
- #render_to_output_buffer(_context, output) ⇒ Object
Methods inherited from Block
#block_delimiter, #block_name, #nodelist, #raise_tag_never_closed, raise_unknown_tag, #render, #unknown_tag
Methods inherited from Tag
disable_tags, #name, parse, #raw, #render
Methods included from ParserSwitching
#parse_with_selected_parser, #strict_parse_with_error_mode_fallback
Constructor Details
#initialize(tag_name, markup, parse_context) ⇒ Doc
30 31 32 33 |
# File 'lib/liquid/tags/doc.rb', line 30 def initialize(tag_name, markup, parse_context) super ensure_valid_markup(tag_name, markup, parse_context) end |
Instance Method Details
#blank? ⇒ Boolean
54 55 56 |
# File 'lib/liquid/tags/doc.rb', line 54 def blank? true end |
#parse(tokens) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/liquid/tags/doc.rb', line 35 def parse(tokens) while (token = tokens.shift) tag_name = token =~ BlockBody::FullTokenPossiblyInvalid && Regexp.last_match(2) raise_nested_doc_error if tag_name == @tag_name if tag_name == block_delimiter parse_context.trim_whitespace = (token[-3] == WhitespaceControl) return end end raise_tag_never_closed(block_name) end |
#render_to_output_buffer(_context, output) ⇒ Object
50 51 52 |
# File 'lib/liquid/tags/doc.rb', line 50 def render_to_output_buffer(_context, output) output end |