lib/css_parser/parser.rb in css_parser-1.1.6 vs lib/css_parser/parser.rb in css_parser-1.1.7
- old
+ new
@@ -213,10 +213,11 @@
current_declarations = ''
block.scan(/([\\]?[{}\s"]|(.[^\s"{}\\]*))/).each do |matches|
#block.scan(/((.[^{}"\n\r\f\s]*)[\s]|(.[^{}"\n\r\f]*)\{|(.[^{}"\n\r\f]*)\}|(.[^{}"\n\r\f]*)\"|(.*)[\s]+)/).each do |matches|
token = matches[0]
+
#puts "TOKEN: #{token}" unless token =~ /^[\s]*$/
if token =~ /\A"/ # found un-escaped double quote
in_string = !in_string
end
@@ -275,9 +276,14 @@
current_selectors += token
end
end
end
end
+
+ # check for unclosed braces
+ if in_declarations > 0
+ add_rule!(current_selectors, current_declarations, media_types)
+ end
end
# Load a remote CSS file.
#
# You can also pass in file://test.css