Allow loud comments to appear beneath nested attributes. Thanks to Hrvoje Marjanovic for pointing this out.

git-svn-id: svn://hamptoncatlin.com/haml/trunk@683 7063305b-7217-0410-af8c-cdc13e5119b9
This commit is contained in:
nex3 2007-12-07 20:09:16 +00:00
parent 8143e161f2
commit b9bf614f6c
4 changed files with 4 additions and 3 deletions

View File

@ -45,7 +45,7 @@ module Sass::Tree
end end
def invalid_child?(child) def invalid_child?(child)
if !child.is_a?(AttrNode) if !child.is_a?(AttrNode) && !child.is_a?(CommentNode)
"Illegal nesting: Only attributes may be nested beneath attributes." "Illegal nesting: Only attributes may be nested beneath attributes."
end end
end end

View File

@ -6,7 +6,7 @@ module Sass::Tree
super(value[2..-1].strip, style) super(value[2..-1].strip, style)
end end
def to_s(parent_name = nil) def to_s(tabs = 0, parent_name = nil)
unless @style == :compressed unless @style == :compressed
join_string = @style == :compact ? ' ' : "\n * " join_string = @style == :compact ? ' ' : "\n * "
"/* #{value}#{join_string unless children.empty?}#{children.join join_string} */" "/* #{value}#{join_string unless children.empty?}#{children.join join_string} */"

View File

@ -3,7 +3,7 @@ body { margin: 0; font: 0.85em "Lucida Grande", "Trebuchet MS", Verdana, sans-se
#page { width: 900px; margin: 0 auto; background: #440008; border-top-width: 5px; border-top-style: solid; border-top-color: #ff8500; } #page { width: 900px; margin: 0 auto; background: #440008; border-top-width: 5px; border-top-style: solid; border-top-color: #ff8500; }
#header { height: 75px; padding: 0; } #header { height: 75px; padding: 0; }
#header h1 { float: left; width: 274px; height: 75px; margin: 0; background-image: url(/images/global_logo.gif); background-repeat: no-repeat; text-indent: -9999px; } #header h1 { float: left; width: 274px; height: 75px; margin: 0; background-image: url(/images/global_logo.gif); /* Crazy nested comment */ background-repeat: no-repeat; text-indent: -9999px; }
#header .status { float: right; padding-top: .5em; padding-left: .5em; padding-right: .5em; padding-bottom: 0; } #header .status { float: right; padding-top: .5em; padding-left: .5em; padding-right: .5em; padding-bottom: 0; }
#header .status p { float: left; margin-top: 0; margin-right: 0.5em; margin-bottom: 0; margin-left: 0; } #header .status p { float: left; margin-top: 0; margin-right: 0.5em; margin-bottom: 0; margin-left: 0; }
#header .status ul { float: left; margin: 0; padding: 0; } #header .status ul { float: left; margin: 0; padding: 0; }

View File

@ -23,6 +23,7 @@ body
:margin 0 :margin 0
:background :background
:image url(/images/global_logo.gif) :image url(/images/global_logo.gif)
/* Crazy nested comment
:repeat no-repeat :repeat no-repeat
:text-indent -9999px :text-indent -9999px
.status .status