cursor++;
}
- if (lastStart < cursor + 1)
- tokens.push(value.substring(lastStart));
+ if (lastStart < cursor + 1) {
+ var lastValue = value.substring(lastStart);
+ var lastCharacter = lastValue[lastValue.length - 1];
+ if (!includeSeparator && (withRegex ? separator.test(lastCharacter) : lastCharacter == separator))
+ lastValue = lastValue.substring(0, lastValue.length - 1);
+
+ tokens.push(lastValue);
+ }
return tokens;
}
assert.deepEqual(split(input, ' '), ['linear-gradient(0, #fff, rgba(0, 0, 0))', 'red']);
}
},
+ 'semicolon separated - single': {
+ topic: 'apply(--var);',
+ split: function (input) {
+ assert.deepEqual(split(input, ';'), ['apply(--var)']);
+ }
+ },
+ 'semicolon separated - double': {
+ topic: 'apply(--var);color:red;',
+ split: function (input) {
+ assert.deepEqual(split(input, ';'), ['apply(--var)', 'color:red']);
+ }
+ },
'with regex': {
topic: 'no-repeat,0/0',
split: function (input) {