public
Description: HTML Abstraction Markup Language - A Markup Haiku
Homepage: http://haml.hamptoncatlin.com
Clone URL: git://github.com/nex3/haml.git
css2sass doesn't get confused by CSS rules starting with . or #

This caused it to trip up on stuff like

.a.b .c { a: b }
.a.b .d { a: b }
nex3 (author)
Tue Apr 29 16:38:43 -0700 2008
commit  5a6d99b83030b8da33e1655a97f9fbd45aa21247
tree    beef3c4256b73b636040ce88976c3a756055aaf9
parent  562a89e200a99884ece3e6e49d59b430509cea88
...
266
267
268
269
 
270
271
272
...
266
267
268
 
269
270
271
272
0
@@ -266,7 +266,7 @@ module Sass
0
       rules = OrderedHash.new
0
       root.children.select { |c| Tree::RuleNode === c }.each do |child|
0
         root.children.delete child
0
- first, rest = child.rule.scan(/^(&?.[^.#: \[]*)([.#: \[].*)?$/).first
0
+ first, rest = child.rule.scan(/^(&?(?: .|[^ ])[^.#: \[]*)([.#: \[].*)?$/).first
0
         rules[first] ||= Tree::RuleNode.new(first, nil)
0
         if rest
0
           child.rule = "&" + rest

Comments

    No one has commented yet.