Skip to content

Commit 7f3c726

Browse files
committed
Retain all comments. Fixes #250
1 parent bbab063 commit 7f3c726

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

stylebot/libs/jscsspimporter.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ function JSCSSPImporter() {
77
this.AT_RULE_PREFIX = "at";
88
this.COMMENT_PREFIX = "comment";
99
this.AT_IMPORT_RULE_TYPE = "@import";
10+
this.commentIndex = 0;
1011
}
1112

1213
JSCSSPImporter.prototype = {
@@ -64,9 +65,10 @@ JSCSSPImporter.prototype = {
6465
},
6566

6667
importComment: function(rule, parent) {
67-
var selector = this.COMMENT_PREFIX + rule.currentLine;
68+
var selector = this.COMMENT_PREFIX + this.commentIndex;
6869
parent[selector] = new Object();
6970
parent[selector][this.COMMENT_PREFIX] = rule.cssText();
71+
this.commentIndex++;
7072
},
7173

7274
importStyleRule: function(rule, parent) {

0 commit comments

Comments
 (0)