level++;
} else if (value[cursor] == closeLevel) {
level--;
- } else if ((withRegex ? separator.test(value[cursor]) : value[cursor] == separator) && level === 0) {
+ }
+
+ if ((withRegex ? separator.test(value[cursor]) : value[cursor] == separator) && level === 0) {
tokens.push(value.substring(lastStart, cursor + (includeSeparator ? 1 : 0)));
lastStart = cursor + 1;
}
split: function (input) {
assert.deepEqual(split(input, ';', false, '{', '}'), ['--my-toolbar:{color:red;width:100%}']);
}
+ },
+ 'with custom wrappers - on close brace': {
+ topic: 'a{ color:red; --var { color:red; display: none } } p{ color:red }',
+ split: function (input) {
+ assert.deepEqual(split(input, '}', true, '{', '}'), [ 'a{ color:red; --var { color:red; display: none } }', ' p{ color:red }', '' ]);
+ }
}
})
.export(module);