Skip to content

Commit 1b81238

Browse files
authored
CSS: Comma punctuation (#1632)
* Show invisibles inside tokens * Revert "Show invisibles inside tokens" This reverts commit 2d622f1. * Added the comma to the list of CSS punctuation
2 parents 39686e1 + c988936 commit 1b81238

File tree

6 files changed

+11
-6
lines changed

6 files changed

+11
-6
lines changed

components/prism-css.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Prism.languages.css = {
1616
'property': /[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,
1717
'important': /!important\b/i,
1818
'function': /[-a-z0-9]+(?=\()/i,
19-
'punctuation': /[(){};:]/
19+
'punctuation': /[(){};:,]/
2020
};
2121

2222
Prism.languages.css['atrule'].inside.rest = Prism.languages.css;

components/prism-css.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/prism-less.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ Prism.languages.less = Prism.languages.extend('css', {
3030
},
3131

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

components/prism-less.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

prism.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ Prism.languages.css = {
637637
'property': /[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,
638638
'important': /!important\b/i,
639639
'function': /[-a-z0-9]+(?=\()/i,
640-
'punctuation': /[(){};:]/
640+
'punctuation': /[(){};:,]/
641641
};
642642

643643
Prism.languages.css['atrule'].inside.rest = Prism.languages.css;

tests/languages/css/function_feature.test

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,13 @@ filter: opacity(alpha=0);
1717
["punctuation", ":"],
1818
["function", "rgba"],
1919
["punctuation", "("],
20-
"0, 0, 0, 0.2",
20+
"0",
21+
["punctuation", ","],
22+
" 0",
23+
["punctuation", ","],
24+
" 0",
25+
["punctuation", ","],
26+
" 0.2",
2127
["punctuation", ")"],
2228
["punctuation", ";"],
2329

0 commit comments

Comments
 (0)