From: Jakub Pawlowicz Date: Sat, 1 Mar 2014 08:59:59 +0000 (+0000) Subject: Refixes #250 via new quotation marks removal algorithm. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=e8ae0b0b2e8a576a4c34ffdcc2cd13aa827b067c;p=clean-css.git Refixes #250 via new quotation marks removal algorithm. --- diff --git a/History.md b/History.md index 219d732b..133aab6b 100644 --- a/History.md +++ b/History.md @@ -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) ================== diff --git a/lib/text/name-quotes.js b/lib/text/name-quotes.js index cb1e8041..b0fedd68 100644 --- a/lib/text/name-quotes.js +++ b/lib/text/name-quotes.js @@ -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', diff --git a/test/unit-test.js b/test/unit-test.js index 473a303f..e478287e 100644 --- a/test/unit-test.js +++ b/test/unit-test.js @@ -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}',