zmoazeni / csscss

A CSS redundancy analyzer that analyzes redundancy.

Home Page:http://zmoazeni.github.io/csscss/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Parsing failing on content with CSS reserved characters

imiric opened this issue · comments

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.

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

Wonderful thanks!! cc @imiric

Excellent! Thank you!