zmoazeni / csscss

A CSS redundancy analyzer that analyzes redundancy.
http://zmoazeni.github.io/csscss/
MIT License
2.92k stars 151 forks source link

Parsing failing on content with CSS reserved characters #70

Closed imiric closed 11 years ago

imiric commented 11 years ago

Hi,

I think this is related to #68.

I have the following CSS:

#menu a::before {
    content: "{";
    left: -6px;
}

#menu a::after {
    content: "}";
    right: -6px;
}

And get the following error:

Had a problem parsing the css at line: 7, column: 16
Failed to match sequence (SPACE? blocks:((COMMENT / IMPORT / NESTED_RULESET / RULESET){1, }) SPACE?) at line 7 char 16.
`- Don't know what to do with "\";\n    rig" at line 7 char 16.

So it seems the parser should be smart enough to skip over the characters defined in the content property.

zmoazeni commented 11 years ago

I just merged @joseluistorres's PR which should fix this bug. It will go out in the release following v1.3.1.

joseluistorres commented 11 years ago

Wonderful thanks!! cc @imiric

imiric commented 11 years ago

Excellent! Thank you!