Merge branch 'master' into yard

Conflicts:
	lib/sass/tree/attr_node.rb
This commit is contained in:
Nathan Weizenbaum 2009-06-01 01:56:36 -07:00
commit 65991b34d9
2 changed files with 7 additions and 5 deletions

View File

@ -48,13 +48,13 @@ module Sass::Tree
end
if value[-1] == ?;
raise Sass::SyntaxError.new("Invalid attribute: #{declaration.dump} (This isn't CSS!).", @line)
raise Sass::SyntaxError.new("Invalid attribute: #{declaration.dump} (no \";\" required at end-of-line).", @line)
end
real_name = name
real_name = "#{parent_name}-#{real_name}" if parent_name
if value.empty? && children.empty?
raise Sass::SyntaxError.new("Invalid attribute: #{declaration.dump}.", @line)
raise Sass::SyntaxError.new("Invalid attribute: #{declaration.dump} (no value).", @line)
end
join_string = case style
@ -103,7 +103,7 @@ module Sass::Tree
private
def declaration
":#{name} #{value}"
@attr_syntax == :new ? "#{name}: #{value}" : ":#{name} #{value}"
end
end
end

View File

@ -18,11 +18,13 @@ class SassEngineTest < Test::Unit::TestCase
":" => 'Invalid attribute: ":".',
": a" => 'Invalid attribute: ": a".',
":= a" => 'Invalid attribute: ":= a".',
"a\n :b" => 'Invalid attribute: ":b ".',
"a\n :b" => 'Invalid attribute: ":b " (no value).',
"a\n b:" => 'Invalid attribute: "b: " (no value).',
"a\n :b: c" => 'Invalid attribute: ":b: c".',
"a\n :b:c d" => 'Invalid attribute: ":b:c d".',
"a\n :b=c d" => 'Invalid attribute: ":b=c d".',
"a\n :b c;" => 'Invalid attribute: ":b c;" (This isn\'t CSS!).',
"a\n :b c;" => 'Invalid attribute: ":b c;" (no ";" required at end-of-line).',
"a\n b: c;" => 'Invalid attribute: "b: c;" (no ";" required at end-of-line).',
"a\n b : c" => 'Invalid attribute: "b : c".',
"a\n b=c: d" => 'Invalid attribute: "b=c: d".',
":a" => 'Attributes aren\'t allowed at the root of a document.',