Skip to content

Commit 4f55be9

Browse files
Merge branch 'main' into patch-2
2 parents 0213737 + 5697ae5 commit 4f55be9

29 files changed

+180
-24
lines changed

CHANGES.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
## Version 11.11.2
22

3+
Themes:
4+
5+
- added "vs Dark " theme [Twineee1][]
6+
37
New Grammars:
48

59
- added 3rd party Aiken grammar to SUPPORTED_LANGUAGES [Josh Marchand][]
610
- added 3rd party VoltScript grammar to SUPPORTED_LANGUAGES [Chester Moses][]
711
- added 3rd party Prisma grammar to SUPPORTED_LANGUAGES [SungHyun Kim][]
812
- added 3rd party Magik grammar to SUPPORTED_LANGUAGES [Sebastiaan Speck][]
913
- added 3rd party Gleam grammar to SUPPORTED_LANGUAGES [Filip Hoffmann][]
14+
- added 3rd party L4 grammar to SUPPORTED_LANGUAGES [Thomas Gorissen][]
15+
- added 3rd party Bicep grammar to SUPPORTED_LANGUAGES [Anthony Martin][]
16+
- added 3rd party Abc Notation grammar to SUPPORTED_LANGUAGES [NriotHrreion][]
1017

1118
Core Grammars:
1219

@@ -16,11 +23,18 @@ Core Grammars:
1623
- fix(ex) adds support for `?'` char literal and missing `defguardp` keyword [Kevin Bloch][]
1724
- fix(diff) fix unified diff hunk header regex to allow unpaired numbers [Chris Wilson][]
1825
- enh(php) support single line and hash comments in attributes, constructor and functions [Antoine Musso][]
26+
- enh(json) add json5 support [Kerry Shetline][]
27+
- fix(css) `unicode-range` parsing, issue #4253 [Kerry Shetline][]
28+
- fix(csharp) Support digit separators [te-ing][]
1929

2030
Documentation:
2131

2232
- alphabetized languages + upper-cased BASIC in SUPPORTED_LANGUAGES.md [Adam Lui][]
2333

34+
Themes:
35+
36+
- Fix: cybertopia themes render correctly in shadow DOM [hbgl][]
37+
2438
CONTRIBUTORS
2539

2640
[Josh Marchand]: https://github.com/yHSJ
@@ -30,10 +44,17 @@ CONTRIBUTORS
3044
[Chris Wilson]: https://github.com/sushicw
3145
[Antoine Musso]: https://github.com/hashar
3246
[Chester Moses]: https://github.com/Chester-Moses-HCL
47+
[Kerry Shetline]: https://github.com/kshetline
3348
[SungHyun Kim]: https://github.com/witch-factory
3449
[Adam Lui]: https://github.com/adamlui
3550
[Sebastiaan Speck]: https://github.com/sebastiaanspeck
3651
[Filip Hoffmann]: https://github.com/folospior
52+
[Twineee1]: https://github.com/Twineee1
53+
[hbgl]: https://github.com/hbgl
54+
[Thomas Gorissen]: https://github.com/serrynaimo
55+
[te-ing]: https://github.com/te-ing
56+
[Anthony Martin]: https://github.com/anthony-c-martin
57+
[NriotHrreion]: https://github.com/NriotHrreion
3758

3859

3960
## Version 11.11.1

SUPPORTED_LANGUAGES.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ The table below shows the full list of languages (and corresponding classes/alia
1010
| 1C | 1c | |
1111
| 4D | 4d |[highlightjs-4d](https://github.com/highlightjs/highlightjs-4d) |
1212
| ABAP | sap-abap, abap |[highlight-sap-abap](https://github.com/highlightjs/highlightjs-sap-abap) |
13+
| Abc Notation | abc |[highlightjs-abc](https://github.com/nocpiun/highlightjs-abc)|
1314
| ABNF | abnf | |
1415
| Access logs | accesslog | |
1516
| ActionScript | actionscript, as | |
@@ -34,6 +35,7 @@ The table below shows the full list of languages (and corresponding classes/alia
3435
| Bash | bash, sh, zsh | |
3536
| BASIC | basic | |
3637
| BBCode | bbcode | [highlightjs-bbcode](https://github.com/RedGuy12/highlightjs-bbcode) |
38+
| Bicep | bicep | [highlightjs-bicep](https://github.com/Azure/bicep/blob/main/docs/highlighting.md#highlightjs) |
3739
| Blade (Laravel) | blade | [highlightjs-blade](https://github.com/miken32/highlightjs-blade) |
3840
| BNF | bnf | |
3941
| BQN | bqn | [highlightjs-bqn](https://github.com/razetime/highlightjs-bqn) |
@@ -116,11 +118,12 @@ The table below shows the full list of languages (and corresponding classes/alia
116118
| Java | java, jsp | |
117119
| JavaScript | javascript, js, jsx | |
118120
| Jolie | jolie, iol, ol | [highlightjs-jolie](https://github.com/xiroV/highlightjs-jolie) |
119-
| JSON | json, jsonc | |
121+
| JSON | json, jsonc, json5 | |
120122
| JSONata | jsonata | [highlightjs-jsonata](https://github.com/DevDimov/highlightjs-jsonata) |
121123
| Julia | julia, jl | |
122124
| Julia REPL | julia-repl | |
123125
| Kotlin | kotlin, kt | |
126+
| L4 | l4, legal | [highlightjs-l4](https://github.com/legalese/highlightjs-l4)
124127
| Lang | | [highlightjs-lang](https://github.com/highlightjs/highlightjs-lang)
125128
| Lasso | lasso, ls, lassoscript | |
126129
| LaTeX | tex | |

src/languages/csharp.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ export default function(hljs) {
166166
variants: [
167167
{ begin: '\\b(0b[01\']+)' },
168168
{ begin: '(-?)\\b([\\d\']+(\\.[\\d\']*)?|\\.[\\d\']+)(u|U|l|L|ul|UL|f|F|b|B)' },
169-
{ begin: '(-?)(\\b0[xX][a-fA-F0-9\']+|(\\b[\\d\']+(\\.[\\d\']*)?|\\.[\\d\']+)([eE][-+]?[\\d\']+)?)' }
169+
{ begin: '(-?)(\\b0[xX][a-fA-F0-9\'_]+|(\\b[\\d\'_]+(\\.[\\d\'_]*)?|\\.[\\d\'_]+)([eE][-+]?[\\d\'_]+)?)' }
170170
],
171171
relevance: 0
172172
};

src/languages/css.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,10 @@ export default function(hljs) {
7373
modes.HEXCOLOR,
7474
modes.IMPORTANT,
7575
modes.CSS_NUMBER_MODE,
76+
modes.UNICODE_RANGE,
7677
...STRINGS,
7778
// needed to highlight these as strings and to avoid issues with
78-
// illegal characters that might be inside urls that would tigger the
79+
// illegal characters that might be inside urls that would trigger the
7980
// languages illegal stack
8081
{
8182
begin: /(url|data-uri)\(/,

src/languages/javascript.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ export default function(hljs) {
457457
keywords: KEYWORDS,
458458
// this will be extended by TypeScript
459459
exports: { PARAMS_CONTAINS, CLASS_REFERENCE },
460-
illegal: /#(?![$_A-z])/,
460+
illegal: /#(?![$_A-Za-z])/,
461461
contains: [
462462
hljs.SHEBANG({
463463
label: "shebang",

src/languages/json.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
/*
22
Language: JSON
33
Description: JSON (JavaScript Object Notation) is a lightweight data-interchange format.
4-
Author: Ivan Sagalaev <[email protected]>
5-
Website: http://www.json.org
4+
Websites: http://www.json.org, https://www.json5.org
65
Category: common, protocols, web
76
*/
87

8+
import { EXTENDED_NUMBER_MODE } from "./lib/ecmascript";
9+
910
export default function(hljs) {
1011
const ATTRIBUTE = {
1112
className: 'attr',
12-
begin: /"(\\.|[^\\"\r\n])*"(?=\s*:)/,
13+
begin: /(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,
1314
relevance: 1.01
1415
};
1516
const PUNCTUATION = {
@@ -34,16 +35,17 @@ export default function(hljs) {
3435

3536
return {
3637
name: 'JSON',
37-
aliases: ['jsonc'],
38+
aliases: ['jsonc', 'json5'],
3839
keywords:{
3940
literal: LITERALS,
4041
},
4142
contains: [
4243
ATTRIBUTE,
4344
PUNCTUATION,
45+
hljs.APOS_STRING_MODE,
4446
hljs.QUOTE_STRING_MODE,
4547
LITERALS_MODE,
46-
hljs.C_NUMBER_MODE,
48+
EXTENDED_NUMBER_MODE,
4749
hljs.C_LINE_COMMENT_MODE,
4850
hljs.C_BLOCK_COMMENT_MODE
4951
],

src/languages/less.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export default function(hljs) {
6767
excludeEnd: true
6868
}
6969
},
70+
modes.UNICODE_RANGE,
7071
modes.HEXCOLOR,
7172
PARENS_MODE,
7273
IDENT_MODE('variable', '@@?' + IDENT_RE, 10),
@@ -177,7 +178,7 @@ export default function(hljs) {
177178
MIXIN_GUARD_MODE,
178179
IDENT_MODE('keyword', 'all\\b'),
179180
IDENT_MODE('variable', '@\\{' + IDENT_RE + '\\}'), // otherwise it’s identified as tag
180-
181+
181182
{
182183
begin: '\\b(' + css.TAGS.join('|') + ')\\b',
183184
className: 'selector-tag'

src/languages/lib/css-shared.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ export const MODES = (hljs) => {
99
scope: 'number',
1010
begin: /#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/
1111
},
12+
UNICODE_RANGE: {
13+
scope: 'number',
14+
begin: /\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,4}(-[0-9A-Fa-f][0-9A-Fa-f]{0,4})?/
15+
},
1216
FUNCTION_DISPATCH: {
1317
className: "built_in",
1418
begin: /[\w-]+(?=\()/
@@ -777,6 +781,7 @@ export const ATTRIBUTES = [
777781
'transition-timing-function',
778782
'translate',
779783
'unicode-bidi',
784+
'unicode-range',
780785
'user-modify',
781786
'user-select',
782787
'vector-effect',

src/languages/lib/ecmascript.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
export const IDENT_RE = '[A-Za-z$_][0-9A-Za-z$_]*';
2+
export const EXTENDED_NUMBER_RE = '([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity'; // 0x..., 0..., decimal, float
3+
4+
export const EXTENDED_NUMBER_MODE = {
5+
scope: 'number',
6+
match: EXTENDED_NUMBER_RE,
7+
relevance: 0
8+
};
9+
210
const KEYWORDS = [
311
"as", // for exports
412
"in",

src/languages/scss.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ export default function(hljs) {
7979
VARIABLE,
8080
modes.HEXCOLOR,
8181
modes.CSS_NUMBER_MODE,
82+
modes.UNICODE_RANGE,
8283
hljs.QUOTE_STRING_MODE,
8384
hljs.APOS_STRING_MODE,
8485
modes.IMPORTANT,

0 commit comments

Comments
 (0)