Skip to content

Commit 7676805

Browse files
committed
Allow URI to match 'url', 'url-prefix', and 'domain'
1 parent 1fb1cad commit 7676805

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/css/TokenStream.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -510,17 +510,18 @@ TokenStream.prototype = mix(new TokenStreamBase(), {
510510
identOrFunctionToken: function(first, startLine, startCol){
511511
var reader = this._reader,
512512
ident = this.readName(first),
513-
tt = Tokens.IDENT;
513+
tt = Tokens.IDENT,
514+
uriFns = ["url(", "url-prefix(", "domain("];
514515

515516
//if there's a left paren immediately after, it's a URI or function
516517
if (reader.peek() == "("){
517518
ident += reader.read();
518-
if (ident.toLowerCase() == "url("){
519+
if (uriFns.indexOf(ident.toLowerCase()) > -1){
519520
tt = Tokens.URI;
520521
ident = this.readURI(ident);
521522

522523
//didn't find a valid URL or there's no closing paren
523-
if (ident.toLowerCase() == "url("){
524+
if (uriFns.indexOf(ident.toLowerCase()) > -1){
524525
tt = Tokens.FUNCTION;
525526
}
526527
} else {

0 commit comments

Comments
 (0)