Skip to content

Commit

Permalink
CSS: Comma punctuation (#1632)
Browse files Browse the repository at this point in the history
* Show invisibles inside tokens

* Revert "Show invisibles inside tokens"

This reverts commit 2d622f1.

* Added the comma to the list of CSS punctuation
  • Loading branch information
mAAdhaTTah authored Dec 1, 2018
2 parents 39686e1 + c988936 commit 1b81238
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion components/prism-css.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Prism.languages.css = {
'property': /[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,
'important': /!important\b/i,
'function': /[-a-z0-9]+(?=\()/i,
'punctuation': /[(){};:]/
'punctuation': /[(){};:,]/
};

Prism.languages.css['atrule'].inside.rest = Prism.languages.css;
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.

1 change: 0 additions & 1 deletion components/prism-less.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ Prism.languages.less = Prism.languages.extend('css', {
},

'property': /(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/i,
'punctuation': /[{}();:,]/,
'operator': /[+\-*\/]/
});

Expand Down
2 changes: 1 addition & 1 deletion components/prism-less.min.js

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

2 changes: 1 addition & 1 deletion prism.js
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ Prism.languages.css = {
'property': /[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,
'important': /!important\b/i,
'function': /[-a-z0-9]+(?=\()/i,
'punctuation': /[(){};:]/
'punctuation': /[(){};:,]/
};

Prism.languages.css['atrule'].inside.rest = Prism.languages.css;
Expand Down
8 changes: 7 additions & 1 deletion tests/languages/css/function_feature.test
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ filter: opacity(alpha=0);
["punctuation", ":"],
["function", "rgba"],
["punctuation", "("],
"0, 0, 0, 0.2",
"0",
["punctuation", ","],
" 0",
["punctuation", ","],
" 0",
["punctuation", ","],
" 0.2",
["punctuation", ")"],
["punctuation", ";"],

Expand Down

0 comments on commit 1b81238

Please sign in to comment.