Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal Server Error #15

Closed
Chris2011 opened this issue Jan 9, 2014 · 2 comments
Closed

Internal Server Error #15

Chris2011 opened this issue Jan 9, 2014 · 2 comments

Comments

@Chris2011
Copy link

Hi,

when I paste this peace of code into your online tool:

a b {
color: red;
}

a > b {

}

I got an Internal Server Error.

Regards

Chris

@jpablobr
Copy link
Owner

jpablobr commented Jan 9, 2014

The problem seems to be with the empty braces.

That said, Css2sass relies on Sass::css built in parser and apparently that's not supported. The only thing I could/should do is to handle the error so it will not 500 like that.

On a pry session:

> require 'sass/css'
> true
> Sass::CSS.new("a b { color: red; } a > b { }").render(:scss)
> NoMethodError: undefined method `subject=' for ">":String
> from .../1.9.3-p448/lib/ruby/gems/1.9.1/gems/sass-3.2.5/lib/sass/css.rb:301:in `block in bubble_subject'
> Sass::CSS.new("a b { color: red; } a > b { color: blue; }").render(:scss)�[1B�[0G"a {\n  b {\n    color: red;\n  }\n  > b {\n    color: blue;\n  }\n}\n"

It might better to open an issue or a pull request over there.

@jpablobr jpablobr closed this as completed Jan 9, 2014
@kanduvisla
Copy link

Just if anyone want to know, this regexp can be used to find lines in your CSS stylesheet that end with empty selectors:

.*\{(\s?|\s+)\}\n

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants