From: GoalSmashers Date: Fri, 29 Mar 2013 23:27:53 +0000 (+0100) Subject: Fixes #88 - extra space in '! important'. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=cdd63f2eed9d8889109339b46c52a457996562ff;p=clean-css.git Fixes #88 - extra space in '! important'. --- diff --git a/History.md b/History.md index 64c56898..a2e187b5 100644 --- a/History.md +++ b/History.md @@ -8,6 +8,7 @@ * Fixed issue [#2](https://github.com/GoalSmashers/clean-css/issues/2) - resolving `@import` rules. * Fixed issue [#80](https://github.com/GoalSmashers/clean-css/issues/80) - quotation in multi line strings. * Fixed issue [#92](https://github.com/GoalSmashers/clean-css/issues/92) - uppercase hex to short versions. +* Fixed issue [#88](https://github.com/GoalSmashers/clean-css/issues/88) - removes space in '! important'. 0.10.2 / 2013-03-19 ================== diff --git a/lib/clean.js b/lib/clean.js index 0bb9804b..6e1561a2 100644 --- a/lib/clean.js +++ b/lib/clean.js @@ -157,7 +157,7 @@ var CleanCSS = { replace(/ ([+~>]) /g, '$1'); // remove extra spaces inside content - replace(/([\(\{\}:;=,\n]) /g, '$1'); + replace(/([!\(\{\}:;=,\n]) /g, '$1'); replace(/ ([!\)\{\};=,\n])/g, '$1'); replace(/(?:\r\n|\n)\}/g, '}'); replace(/([\{;,])(?:\r\n|\n)/g, '$1'); diff --git a/test/unit-test.js b/test/unit-test.js index 9810c9ab..9fb057a9 100644 --- a/test/unit-test.js +++ b/test/unit-test.js @@ -699,6 +699,10 @@ title']", 'space before': [ "body{background-color:#fff !important}", "body{background-color:#fff!important}" + ], + 'space between ! and important': [ + "body{background-color:#fff ! important}", + "body{background-color:#fff!important}" ] }), 'empty elements': cssContext({