Fixes #276 - unicode content mistakenly taken as IE hacks.
authorJakub Pawlowicz <jakub@goalsmashers.com>
Wed, 11 Jun 2014 21:04:26 +0000 (22:04 +0100)
committerJakub Pawlowicz <jakub@goalsmashers.com>
Wed, 11 Jun 2014 21:08:04 +0000 (22:08 +0100)
History.md
lib/properties/optimizer.js
test/unit-test.js

index 34a42bf..b7bcc35 100644 (file)
@@ -22,6 +22,7 @@
 * Fixed issue [#257](https://github.com/GoalSmashers/clean-css/issues/257) - turns hsla/rgba to transparent if possible.
 * Fixed issue [#265](https://github.com/GoalSmashers/clean-css/issues/265) - adds support for multiple input files.
 * Fixed issue [#275](https://github.com/GoalSmashers/clean-css/issues/275) - handling transform properties.
+* Fixed issue [#276](https://github.com/GoalSmashers/clean-css/issues/276) - corrects unicode handling.
 * Fixed issue [#288](https://github.com/GoalSmashers/clean-css/issues/288) - adds smarter expression parsing.
 * Fixed issue [#293](https://github.com/GoalSmashers/clean-css/issues/293) - handles escaped @ symbols in classnames and ids.
 
index c4533e9..ce90085 100644 (file)
@@ -133,7 +133,7 @@ module.exports = function Optimizer(compatibility, aggressiveMerging) {
         token.substring(0, firstColon),
         token.substring(firstColon + 1),
         token.indexOf('!important') > -1,
-        token.indexOf(IE_BACKSLASH_HACK, firstColon + 1) > 0
+        token.indexOf(IE_BACKSLASH_HACK, firstColon + 1) === token.length - IE_BACKSLASH_HACK.length
       ]);
     }
 
index 2da2e4e..00d4e12 100644 (file)
@@ -806,6 +806,9 @@ vows.describe('clean-units').addBatch({
     ],
     'font weight in extended font declarations': 'font:normal normal normal 13px/20px Helvetica'
   }),
+  'unicode': cssContext({
+    'font-names': 'body{font-family:\\5FAE\\8F6F\\96C5\\9ED1,\\5B8B\\4F53,sans-serif}'
+  }),
   'urls': cssContext({
     'keep urls without parentheses unchanged': 'a{background:url(/images/blank.png) 0 0 no-repeat}',
     'keep non-encoded data URI unchanged': ".icon-logo{background-image:url('data:image/svg+xml;charset=US-ASCII')}",