Why:
* When there is no space after nested block scope, e.g.
`@media(` in `@media(min-width:100px)` it should still be
handled correctly by tokenizer.
==================
* Fixed issue [#881](https://github.com/jakubpawlowicz/clean-css/issues/881) - incorrect `require` arity.
+* Fixed issue [#880](https://github.com/jakubpawlowicz/clean-css/issues/880) - incorrect token type identification.
[4.0.4 / 2017-02-04](https://github.com/jakubpawlowicz/clean-css/compare/v4.0.3...v4.0.4)
==================
'@supports'
];
+var RULE_WORD_SEPARATOR_PATTERN = /[\s\(]/;
var TAIL_BROKEN_VALUE_PATTERN = /[\s|\}]*$/;
function tokenize(source, externalContext) {
function tokenTypeFrom(buffer) {
var isAtRule = buffer[0] == Marker.AT || buffer[0] == Marker.UNDERSCORE;
- var ruleWord = buffer.join('').split(/\s/)[0];
+ var ruleWord = buffer.join('').split(RULE_WORD_SEPARATOR_PATTERN)[0];
if (isAtRule && BLOCK_RULES.indexOf(ruleWord) > -1) {
return Token.NESTED_BLOCK;
]
]
],
+ 'media query without space abc': [
+ '@media(min-width:980px){.block{color:red}}',
+ [
+ [
+ 'nested-block',
+ [
+ [
+ 'nested-block-scope',
+ '@media(min-width:980px)',
+ [
+ [1, 0, undefined]
+ ]
+ ]
+ ],
+ [
+ [
+ 'rule',
+ [
+ [
+ 'rule-scope',
+ '.block',
+ [
+ [1, 24, undefined]
+ ]
+ ]
+ ],
+ [
+ [
+ 'property',
+ [
+ 'property-name',
+ 'color',
+ [
+ [1, 31, undefined]
+ ]
+ ],
+ [
+ 'property-value',
+ 'red',
+ [
+ [1, 37, undefined]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
'multiple media query': [
'@media print,(min-width:980px){a{color:red}}',
[