diff --git a/index.html b/index.html
index a4fa0d501..80ba9e465 100755
--- a/index.html
+++ b/index.html
@@ -11,7 +11,7 @@
body, html{ height: 100%; margin: 0;}
-
+
diff --git a/src/parser/model/ParserCss.js b/src/parser/model/ParserCss.js
index 4da3685bf..ae4711650 100644
--- a/src/parser/model/ParserCss.js
+++ b/src/parser/model/ParserCss.js
@@ -22,7 +22,7 @@ define(function(require) {
var sel = sels[i].trim();
// Will accept only concatenated classes and last
// class might be with state (eg. :hover), nothing else.
- if (/^(\.{1}[\w\-]+)+(:{1}[\w\-]+)?$/ig.test(sel)) {
+ if (/^(\.{1}[\w\-]+)+(:{1}[\w\-()]+)?$/ig.test(sel)) {
var cls = sel.split('.').filter(Boolean);
result.push(cls);
}
diff --git a/test/specs/parser/model/ParserCss.js b/test/specs/parser/model/ParserCss.js
index 52e2896c5..c150ee58d 100644
--- a/test/specs/parser/model/ParserCss.js
+++ b/test/specs/parser/model/ParserCss.js
@@ -101,6 +101,16 @@ define([path + 'model/ParserCss',],
obj.parse(str).should.deep.equal(result);
});
+ it('Parse rule with nth-x state', function() {
+ var str = ' .test1.test2:nth-of-type(2n){ color:red }';
+ var result = {
+ selectors: ['test1', 'test2'],
+ style: { color: 'red'},
+ state: 'nth-of-type(2n)'
+ };
+ obj.parse(str).should.deep.equal(result);
+ });
+
});
}