From 382e0ede5a71ea36e465e6a3c70852b978ca4557 Mon Sep 17 00:00:00 2001 From: Jakub Pawlowicz Date: Tue, 10 Feb 2015 15:51:08 +0000 Subject: [PATCH] Fixes tokenization regression issue. Introduced in a9c75d34. --- lib/selectors/tokenizer.js | 2 +- test/selectors/tokenizer-test.js | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/selectors/tokenizer.js b/lib/selectors/tokenizer.js index 79e49474..af80009b 100644 --- a/lib/selectors/tokenizer.js +++ b/lib/selectors/tokenizer.js @@ -13,7 +13,7 @@ function Tokenizer(minifyContext, addMetadata, addSourceMap) { Tokenizer.prototype.toTokens = function (data) { data = data .replace(/\r\n/g, '\n') - .replace(/\)([^\s\{_;,])/g, this.addSourceMap ? ') __ESCAPED_COMMENT_CLEAN_CSS(0,-1)__$1' : ') $1'); + .replace(/\)([^\s\{_;:,])/g, this.addSourceMap ? ') __ESCAPED_COMMENT_CLEAN_CSS(0,-1)__$1' : ') $1'); var chunker = new Chunker(data, '}', 128); if (chunker.isEmpty()) diff --git a/test/selectors/tokenizer-test.js b/test/selectors/tokenizer-test.js index f3be5223..0d8df0c3 100644 --- a/test/selectors/tokenizer-test.js +++ b/test/selectors/tokenizer-test.js @@ -149,6 +149,14 @@ vows.describe(Tokenizer) ] }] ], + 'pseudoselector after an argument one': [ + 'div:nth-child(2n):not(.test){}', + [{ + kind: 'selector', + value: [{ value: 'div:nth-child(2n):not(.test)' }], + body: [] + }] + ], 'media query': [ '@media (min-width:980px){}', [{ -- 2.34.1