From 7f3c726c3fc429fd29584876b67997ef0926108b Mon Sep 17 00:00:00 2001 From: Ankit Ahuja Date: Thu, 11 Jul 2013 19:00:41 -0700 Subject: [PATCH] Retain all comments. Fixes #250 --- stylebot/libs/jscsspimporter.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stylebot/libs/jscsspimporter.js b/stylebot/libs/jscsspimporter.js index e8c5270b..ea4cf222 100644 --- a/stylebot/libs/jscsspimporter.js +++ b/stylebot/libs/jscsspimporter.js @@ -7,6 +7,7 @@ function JSCSSPImporter() { this.AT_RULE_PREFIX = "at"; this.COMMENT_PREFIX = "comment"; this.AT_IMPORT_RULE_TYPE = "@import"; + this.commentIndex = 0; } JSCSSPImporter.prototype = { @@ -64,9 +65,10 @@ JSCSSPImporter.prototype = { }, importComment: function(rule, parent) { - var selector = this.COMMENT_PREFIX + rule.currentLine; + var selector = this.COMMENT_PREFIX + this.commentIndex; parent[selector] = new Object(); parent[selector][this.COMMENT_PREFIX] = rule.cssText(); + this.commentIndex++; }, importStyleRule: function(rule, parent) {