Class: HamlLint::Tree::HamlCommentNode
- Defined in:
- lib/haml_lint/tree/haml_comment_node.rb
Overview
Represents a HAML comment node.
Instance Attribute Summary
Attributes inherited from Node
#children, #line, #parent, #type
Instance Method Summary collapse
-
#text ⇒ String
Returns the full text content of this comment, including newlines if a single comment spans multiple lines.
Methods inherited from Node
#find, #initialize, #inspect, #next_node, #source_code, #successor
Constructor Details
This class inherits a constructor from HamlLint::Tree::Node
Instance Method Details
#text ⇒ String
Returns the full text content of this comment, including newlines if a single comment spans multiple lines.
8 9 10 11 12 13 14 15 16 |
# File 'lib/haml_lint/tree/haml_comment_node.rb', line 8 def text content = source_code indent = content[/^ */] content.gsub(/^#{indent}/, '') .gsub(/^-#/, '') .gsub(/^ /, '') .rstrip end |