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

Comments/charset declarations are included in selectors

tomdenbraber opened this issue · comments

commented

Hi,

I encountered the problem that the CSS parser includes comments in selector names. Example CSS:

/* A comment before a selector*/
h1 {
   /* 
     some redundant selectors here
     ...
   */ 
}

Let's assume h1 contains redundancy and ends up in the JSON structure. This JSON structure now contains a selector in the list called "/* A comment before a selector*/h1", while the correct selector is just "h1".

The same problem occurs when having a @charset declaration just before a selector.

Thanks in advance!