Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
joshgoebel committed Sep 22, 2024
1 parent b531a56 commit 431ada2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/languages/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ export default function(hljs) {
const VENDOR_PREFIX = { begin: /-(webkit|moz|ms|o)-(?=[a-z])/ };
const AT_MODIFIERS = "and or not only";
const AT_PROPERTY_RE = /@-?\b\w[\w-]*\b/; // @-webkit-keyframes
const IDENT_RE = '[a-zA-Z_-](?:[a-zA-Z0-9_-]*\\\\[.$^&+|~=:<>*\\[\\]@])?[a-zA-Z0-9_-]*(?:\\\\:[a-zA-Z0-9_-]+)*';
const IDENT_RE = /[a-zA-Z-][a-zA-Z0-9_-]*/;
const SELECTOR_RE = /[a-zA-Z_-]([a-zA-Z0-9_-]|\\[.$^&+|~=:<>*\[\]@])*/;
const STRINGS = [
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE
Expand All @@ -37,12 +38,12 @@ export default function(hljs) {
modes.CSS_NUMBER_MODE,
{
className: 'selector-id',
begin: '#' + IDENT_RE,
begin: regex.concat(/#/, IDENT_RE),
relevance: 0
},
{
className: 'selector-class',
begin: '\\.' + IDENT_RE,
begin: regex.concat(/\./, SELECTOR_RE),
relevance: 0
},
modes.ATTRIBUTE_SELECTOR_MODE,
Expand Down

0 comments on commit 431ada2

Please sign in to comment.