Permalink
Browse files

Fixes #250 - correctly handle JSON data in quotations.

It's a quick fix. Proper one comes to master soon.
  • Loading branch information...
1 parent c70572f commit b02a1d0f7f404dc24c94b6f6a8d16db93479e11f @GoalSmashers GoalSmashers committed Mar 1, 2014
Showing with 10 additions and 1 deletion.
  1. +5 −0 History.md
  2. +3 −0 lib/clean.js
  3. +2 −1 test/unit-test.js
View
@@ -4,6 +4,11 @@
* Adds a better non-adjacent optimizer compatible with the upcoming new property optimizer.
* Fixed issue [#247](https://github.com/GoalSmashers/clean-css/issues/247) - removes deprecated `selectorsMergeMode` switch.
+[2.1.4 / 2014-xx-xx](https://github.com/GoalSmashers/clean-css/compare/v2.1.3...v2.1.4)
+==================
+
+* Fixed issue [#250](https://github.com/GoalSmashers/clean-css/issues/250) - correctly handle JSON data in quotations.
+
[2.1.3 / 2014-02-26](https://github.com/GoalSmashers/clean-css/compare/v2.1.2...v2.1.3)
==================
View
@@ -144,6 +144,9 @@ var minify = function(data, callback) {
// strip parentheses in animation & font names
replace(/(animation|animation\-name|font|font\-family):([^;}]+)/g, function(match, propertyName, def) {
+ if (def.indexOf('\'{') === 0)
+ return match;
+
return propertyName + ':' + def.replace(/['"]([a-zA-Z][a-zA-Z\d\-_]+)['"]/g, '$1');
});
View
@@ -806,7 +806,8 @@ path)}',
'a{background:url("/very/long/\
path")}',
'a{background:url(/very/long/path)}'
- ]
+ ],
+ 'do not remove quotation from enclosed JSON (weird, I know)': "p{font-family:'{ \"current\" : \"large\", \"all\" : [\"small\", \"medium\", \"large\"], \"position\" : 2 }'}"
}),
'urls rewriting - no root or target': cssContext({
'no @import': 'a{background:url(test/data/partials/extra/down.gif) 0 0 no-repeat}',

0 comments on commit b02a1d0

Please sign in to comment.