We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d3ecad2 commit 2a2e99eCopy full SHA for 2a2e99e
lib/parser.js
@@ -293,7 +293,9 @@ module.exports = class Parser {
293
// url functions get special treatment, and anything between the function
294
// parens get treated as one word, if the contents aren't not a string.
295
if (this.current.type === 'func' && this.current.unbalanced &&
296
- this.current.value === 'url' && this.currToken[0] !== 'string') {
+ this.current.value === 'url' && this.currToken[0] !== 'string' &&
297
+ this.currToken[0] !== ')') {
298
+
299
let nextToken = this.nextToken,
300
value = this.currToken[1],
301
start = {
test/function.js
@@ -23,6 +23,18 @@ describe('Parser → Function', () => {
23
{ type: 'paren', value: ')' }
24
]
25
},
26
+ {
27
+ it: 'should parse empty url function with values following',
28
+ test: 'url() foo bar baz',
29
+ expected: [
30
+ { type: 'func', value: 'url' },
31
+ { type: 'paren', value: '(' },
32
+ { type: 'paren', value: ')' },
33
+ { type: 'word', value: 'foo' },
34
+ { type: 'word', value: 'bar' },
35
+ { type: 'word', value: 'baz' }
36
+ ]
37
+ },
38
{
39
it: 'should parse url function',
40
test: 'url( /gfx/img/bg.jpg )',
@@ -131,8 +143,6 @@ describe('Parser → Function', () => {
131
143
let ast = new Parser(fixture.test).parse(),
132
144
index = 0;
133
145
134
- // console.log(ast.first.first.nodes);
135
-
136
146
ast.first.walk((node) => {
137
147
let expected = fixture.expected[index];
138
148
index ++;
test/tokenize.js
@@ -21,7 +21,6 @@ describe('Tokenize', () => {
21
fixtures.forEach((fixture) => {
22
it('should tokenize ' + fixture.value.replace(/\n/g, '\\n').replace(/\t/g, '\\t'), () => {
let tokens = tokenize(fixture.value);
- console.log(tokens);
expect(tokens.length).to.equal(fixture.expectedLength);
});
0 commit comments