anandthakker / doiuse

:bomb: Lint CSS for browser support against caniuse database.
MIT License
1.25k stars 51 forks source link

[css-tokenize] unfinished business #192

Open kyle-cyberprairie opened 2 months ago

kyle-cyberprairie commented 2 months ago

I have tried running the example input but it just outputs like below. Can someone tell me what I'm doing wrong?

$ doiuse --browsers "ie >= 9, > 1%, last 2 versions" style.css
[css-tokenize] unfinished business [
  [ 'root' ],       [ 'comment' ],
  [ 'string', 39 ], [ 'comment' ],
  [ 'string', 39 ], [ 'comment' ],
  [ 'string', 39 ], [ 'comment' ],
  [ 'string', 39 ], [ 'comment' ],
  [ 'string', 39 ], [ 'comment' ],
  [ 'string', 39 ], [ 'comment' ],
  [ 'string', 39 ], [ 'comment' ],
  [ 'string', 39 ], [ 'comment' ],
  [ 'string', 39 ], [ 'comment' ],
  [ 'string', 39 ], [ 'comment' ],
  [ 'string', 39 ], [ 'comment' ],
  [ 'string', 39 ], [ 'comment' ],
  [ 'string', 39 ], [ 'comment' ]
]

Using node v16.20.2

craigerm commented 1 month ago

Same issue for me with node v20.18.

It looks like it's failing for a single quote inside a comment.

Example valid use case: /* Fallback style when browser doesn't support... */

Minimal reproducible example:

Fails:

/* comment with ' char */
.focused {
  color: blue;
}

Works:

/* comment with 'wrapped' chars */
.focused {
  color: blue;
}

Temp workaround: remove the quote from the comment.