fix(css, less, scss, stylus) do not highlight digits in preserve-3d - #4545
Open
dyk1454683243-sudo wants to merge 2 commits into
Open
dyk1454683243-sudo wants to merge 2 commits into
dyk1454683243-sudo wants to merge 2 commits into
Conversation
CSS_NUMBER_MODE used NUMBER_RE's word boundary, so the `3` in identifier-internal values like `preserve-3d` was scoped as a number. Require that a number not start after an identifier-continuing `-<digit>`. Ordinary lengths (`3px`, `0.5rem`) and negative lengths (`-3px`) are unchanged. Fixes highlightjs#4531 Assisted-by: Grok 4.6 (high) Co-authored-by: David <dyk1454683243-sudo@users.noreply.github.com>
Language grammars are linted as ES2015, so lookbehind is rejected. Ignore number matches whose digit starts after an identifier-continuing hyphen. Stylus unicode-range no longer paints the digits after the hyphen in U+0025-00FF, which is the same boundary. Assisted-by: Grok 4.6 (high) Co-authored-by: David <dyk1454683243-sudo@users.noreply.github.com>
dyk1454683243-sudo
marked this pull request as ready for review
September 20, 2026 03:18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4531
Changes
transform-style: preserve-3dhighlighted the3ashljs-numberbecause sharedCSS_NUMBER_MODEis built onNUMBER_RE(\b\d+…), and\bmatches between-and a digit.on:beginnow ignores a number whose digit starts after an identifier-continuing hyphen (preserve-3d,*-2d, …). Ordinary lengths (3px,0.5rem,100%) and negative lengths (-3px) still highlight as numbers. No per-keyword*-3dlist.Lookbehind would express the same rule, but language grammars are linted as ES2015, so the callback is the 11.x-safe version.
Stylus does not apply
UNICODE_RANGEon property values, soU+0025-00FFused to paint00after the hyphen as a number. That expect is updated for the same boundary.Markup coverage is a dedicated
preserve-3dCSS case plus the same snippet on the shared css/less/scss/stylus consistency fixtures.Checklist
Assisted-by: Grok 4.6 (high)