Refixes #250 via new quotation marks removal algorithm.
authorJakub Pawlowicz <jakub@goalsmashers.com>
Sat, 1 Mar 2014 08:59:59 +0000 (08:59 +0000)
committerJakub Pawlowicz <jakub@goalsmashers.com>
Sat, 1 Mar 2014 23:36:20 +0000 (23:36 +0000)
History.md
lib/text/name-quotes.js
test/unit-test.js

index 219d732..133aab6 100644 (file)
@@ -5,6 +5,7 @@
 * Adds a better non-adjacent optimizer compatible with the upcoming new property optimizer.
 * Moves quotation matching into a QuoteScanner class.
 * Fixed issue [#247](https://github.com/GoalSmashers/clean-css/issues/247) - removes deprecated `selectorsMergeMode` switch.
+* Refixed issue [#250](https://github.com/GoalSmashers/clean-css/issues/250) - based on new quotation marks removal.
 
 [2.1.4 / 2014-03-01](https://github.com/GoalSmashers/clean-css/compare/v2.1.3...v2.1.4)
 ==================
index cb1e804..b0fedd6 100644 (file)
@@ -4,7 +4,7 @@
 
   var NameQuotes = function NameQuotes() {};
 
-  var STRIPPABLE = /['"][a-zA-Z][a-zA-Z\d\-_]+['"]/;
+  var STRIPPABLE = /^['"][a-zA-Z][a-zA-Z\d\-_]+['"]$/;
 
   var properties = [
     'animation',
index 473a303..e478287 100644 (file)
@@ -895,7 +895,8 @@ path")}',
     'remove font quotation #3': [
       "a{font:12px/16px \"Helvetica-Regular\",'Arial-Bold'}",
       "a{font:12px/16px Helvetica-Regular,Arial-Bold}"
-    ]
+    ],
+    'do not remove quotation from enclosed JSON (weird, I know)': "p{font-family:'{ \"current\" : \"large\", \"all\" : [\"small\", \"medium\", \"large\"], \"position\" : 2 }'}"
   }),
   'IE hacks': cssContext({
     'star': 'a{*color:#fff}',