diff --git a/lib/sass/tree/comment_node.rb b/lib/sass/tree/comment_node.rb index 463cfa95..6ec6ae57 100644 --- a/lib/sass/tree/comment_node.rb +++ b/lib/sass/tree/comment_node.rb @@ -49,14 +49,14 @@ module Sass::Tree # @see #invisible? def to_s(tabs = 0, _ = nil) return if invisible? + spaces = ' ' * (tabs - 1) content = (value.split("\n") + lines.map {|l| l.text}) - return "/* */" if content.empty? + return spaces + "/* */" if content.empty? content.map! {|l| (l.empty? ? "" : " ") + l} content.first.gsub!(/^ /, '') content.last.gsub!(%r{ ?\*/ *$}, '') - spaces = ' ' * (tabs - 1) spaces + "/* " + content.join(style == :compact ? '' : "\n#{spaces} *") + " */" end diff --git a/test/sass/engine_test.rb b/test/sass/engine_test.rb index ab8116df..d5572abc 100755 --- a/test/sass/engine_test.rb +++ b/test/sass/engine_test.rb @@ -793,8 +793,14 @@ SASS def test_empty_comment assert_equal(<