csspool icon indicating copy to clipboard operation
csspool copied to clipboard

Gracefully Fail from Invalid Syntax

Open maedi opened this issue 13 years ago • 4 comments

Running CSSPool against real-world poorly written syntax always results in errors like:

  • parse error on value "}\n" (RBRACE)
  • parse error on value ";" (SEMI)
  • And selectors with ":not" return a 'parse error on value ":not(" (error)'

How do I make CSSPool just skip over the rule_set that it is having difficulties with? Thereby keeping all the valid CSS objects.

Thanks

maedi avatar Aug 05 '12 11:08 maedi

Can you please attach some example of the types of CSS that you have seen causing the first two errors?

miketierney avatar Aug 22 '12 06:08 miketierney

@Maedi Is there a test case that you can provide so I can handle this issue?

Note that the :not() selector's support will be added when #26 is resolved.

miketierney avatar Oct 09 '12 22:10 miketierney

This CSS file fails https://gist.github.com/3910036.

Sorry, I don't have time to provide a more precise test case now. :(

sorich87 avatar Oct 18 '12 05:10 sorich87

Another example:

Racc::ParseError: parse error on value ";" (SEMI)

When parsing http://www.restorethegulf.gov/sites/default/files/css/css_ee40f25a5b9a23323f5a7cbad56dd21e.css

sutch avatar Jul 27 '13 13:07 sutch