Skip to content

Commit

Permalink
CSS: Improved url and string regexps + handle \r
Browse files Browse the repository at this point in the history
  • Loading branch information
Golmote committed Jul 8, 2015
1 parent e254088 commit 901812c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions components/prism-css.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Prism.languages.css = {
// See rest below
}
},
'url': /url\((?:(["'])(\\\n|\\?.)*?\1|.*?)\)/i,
'url': /url\((?:(["'])(\\[\w\W]|(?!\1)[^\\\r\n])*\1|.*?)\)/i,
'selector': /[^\{\}\s][^\{\};]*(?=\s*\{)/,
'string': /("|')(\\\n|\\?.)*?\1/,
'string': /("|')(\\[\w\W]|(?!\1)[^\\\r\n])*\1/,
'property': /(\b|\B)[\w-]+(?=\s*:)/i,
'important': /\B!important\b/i,
'function': /[-a-z0-9]+(?=\()/i,
Expand Down
2 changes: 1 addition & 1 deletion components/prism-css.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions prism.js
Original file line number Diff line number Diff line change
Expand Up @@ -491,9 +491,9 @@ Prism.languages.css = {
// See rest below
}
},
'url': /url\((?:(["'])(\\\n|\\?.)*?\1|.*?)\)/i,
'url': /url\((?:(["'])(\\[\w\W]|(?!\1)[^\\\r\n])*\1|.*?)\)/i,
'selector': /[^\{\}\s][^\{\};]*(?=\s*\{)/,
'string': /("|')(\\\n|\\?.)*?\1/,
'string': /("|')(\\[\w\W]|(?!\1)[^\\\r\n])*\1/,
'property': /(\b|\B)[\w-]+(?=\s*:)/i,
'important': /\B!important\b/i,
'function': /[-a-z0-9]+(?=\()/i,
Expand Down

0 comments on commit 901812c

Please sign in to comment.