Skip to content

Conversation

@akhtarmdsaad
Copy link
Contributor

Fixed CSS variable detection Syntax

It resolves the issue #3823

Changes

There is a bug in src/languages/lib/css-shared.js file.
adding an underscore( _ ) in CSS_VARIABLES fixes the problem.
Code Before:

CSS_VARIABLE: {
className: "attr",
begin: /--[A-Za-z][A-Za-z0-9_-]*/
}

image

Code After:

CSS_VARIABLE: {
className: "attr",
begin: /--[A-Za-z_][A-Za-z0-9_-]*/
//Look change in ^ here
}

after

Checklist

  • Added markup tests, or they don't apply here because...
  • Updated the changelog at CHANGES.md
akhtarmdsaad referenced this pull request in akhtarmdsaad/highlight.js Sep 19, 2023
@github-actions
Copy link

github-actions bot commented Oct 8, 2023

Build Size Report

Changes to minified artifacts in /build, after gzip compression.

8 files changed

Total change +11 B

View Changes
file base pr diff
es/languages/css.min.js 3.39 KB 3.39 KB +2 B
es/languages/less.min.js 3.79 KB 3.79 KB +1 B
es/languages/scss.min.js 3.85 KB 3.85 KB +1 B
es/languages/stylus.min.js 3.49 KB 3.49 KB +2 B
languages/css.min.js 3.4 KB 3.4 KB +2 B
languages/less.min.js 3.79 KB 3.79 KB +1 B
languages/scss.min.js 3.86 KB 3.86 KB +1 B
languages/stylus.min.js 3.5 KB 3.5 KB +1 B
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants