1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00
haml--haml/lib/sass/tree/comment_node.rb
nex3 ff78101c3d Better nested comment formatting.
git-svn-id: svn://hamptoncatlin.com/haml/trunk@684 7063305b-7217-0410-af8c-cdc13e5119b9
2007-12-07 20:30:36 +00:00

20 lines
493 B
Ruby

require 'sass/tree/node'
module Sass::Tree
class CommentNode < ValueNode
def initialize(value, style)
super(value[2..-1].strip, style)
end
def to_s(tabs = 0, parent_name = nil)
return if @style == :compressed
spaces = ' ' * (tabs - 1)
join_string = @style == :compact ? ' ' : "\n#{spaces} * "
str = "#{spaces}/* #{value}"
str << join_string unless children.empty?
str << "#{children.join join_string} */"
str
end
end
end