Skip to content

Commit 82394d3

Browse files
committed
Update Prism to 1.29.0
There are now 297 (from 290) syntaxes supported. * Add `bbj`, `bqn`, `cilkc`, `cilkcpp`, `gradle`, `metafont`, `wgsl`, See: <https://github.com/PrismJS/prism/blob/master/CHANGELOG.md#1290-2022-08-23>
1 parent 40494b8 commit 82394d3

File tree

21 files changed

+466
-19
lines changed

21 files changed

+466
-19
lines changed

lang/asciidoc.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default function asciidoc(Prism) {
3232
}
3333
var asciidoc = (Prism.languages.asciidoc = {
3434
'comment-block': {
35-
pattern: /^(\/{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1/m,
35+
pattern: /^(\/{4,})$[\s\S]*?^\1/m,
3636
alias: 'comment'
3737
},
3838
table: {
@@ -50,22 +50,21 @@ export default function asciidoc(Prism) {
5050
}
5151
},
5252
'passthrough-block': {
53-
pattern: /^(\+{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m,
53+
pattern: /^(\+{4,})$[\s\S]*?^\1$/m,
5454
inside: {
5555
punctuation: /^\++|\++$/ // See rest below
5656
}
5757
},
5858
// Literal blocks and listing blocks
5959
'literal-block': {
60-
pattern: /^(-{4,}|\.{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m,
60+
pattern: /^(-{4,}|\.{4,})$[\s\S]*?^\1$/m,
6161
inside: {
6262
punctuation: /^(?:-+|\.+)|(?:-+|\.+)$/ // See rest below
6363
}
6464
},
6565
// Sidebar blocks, quote blocks, example blocks and open blocks
6666
'other-block': {
67-
pattern:
68-
/^(--|\*{4,}|_{4,}|={4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m,
67+
pattern: /^(--|\*{4,}|_{4,}|={4,})$[\s\S]*?^\1$/m,
6968
inside: {
7069
punctuation: /^(?:-+|\*+|_+|=+)|(?:-+|\*+|_+|=+)$/ // See rest below
7170
}

lang/bash.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-nocheck
22
bash.displayName = 'bash'
3-
bash.aliases = ['shell']
3+
bash.aliases = ['sh', 'shell']
44

55
/** @type {import('../core.js').Syntax} */
66
export default function bash(Prism) {
@@ -108,7 +108,7 @@ export default function bash(Prism) {
108108
// Highlight variable names as variables in the left-hand part
109109
// of assignments (“=” and “+=”).
110110
'assign-left': {
111-
pattern: /(^|[\s;|&]|[<>]\()\w+(?=\+?=)/,
111+
pattern: /(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,
112112
inside: {
113113
environment: {
114114
pattern: RegExp('(^|[\\s;|&]|[<>]\\()' + envVars),
@@ -119,6 +119,12 @@ export default function bash(Prism) {
119119
alias: 'variable',
120120
lookbehind: true
121121
},
122+
// Highlight parameter names as variables
123+
parameter: {
124+
pattern: /(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,
125+
alias: 'variable',
126+
lookbehind: true
127+
},
122128
string: [
123129
// Support for Here-documents https://en.wikipedia.org/wiki/Here_document
124130
{
@@ -166,7 +172,7 @@ export default function bash(Prism) {
166172
variable: insideString.variable,
167173
function: {
168174
pattern:
169-
/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,
175+
/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,
170176
lookbehind: true
171177
},
172178
keyword: {
@@ -215,6 +221,7 @@ export default function bash(Prism) {
215221
'function-name',
216222
'for-or-select',
217223
'assign-left',
224+
'parameter',
218225
'string',
219226
'environment',
220227
'function',
@@ -232,6 +239,7 @@ export default function bash(Prism) {
232239
inside[toBeCopied[i]] = Prism.languages.bash[toBeCopied[i]]
233240
}
234241

242+
Prism.languages.sh = Prism.languages.bash
235243
Prism.languages.shell = Prism.languages.bash
236244
})(Prism)
237245
}

lang/bbj.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// @ts-nocheck
2+
bbj.displayName = 'bbj'
3+
bbj.aliases = []
4+
5+
/** @type {import('../core.js').Syntax} */
6+
export default function bbj(Prism) {
7+
;(function (Prism) {
8+
Prism.languages.bbj = {
9+
comment: {
10+
pattern: /(^|[^\\:])rem\s+.*/i,
11+
lookbehind: true,
12+
greedy: true
13+
},
14+
string: {
15+
pattern: /(['"])(?:(?!\1|\\).|\\.)*\1/,
16+
greedy: true
17+
},
18+
number: /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,
19+
keyword:
20+
/\b(?:abstract|all|argc|begin|bye|callback|case|chn|class|classend|ctl|day|declare|delete|dim|dom|dread|dsz|else|end|endif|err|exitto|extends|fi|field|for|from|gosub|goto|if|implements|interface|interfaceend|iol|iolist|let|list|load|method|methodend|methodret|on|opts|pfx|print|private|process_events|protected|psz|public|read|read_resource|release|remove_callback|repeat|restore|return|rev|seterr|setesc|sqlchn|sqlunt|ssn|start|static|swend|switch|sys|then|tim|unt|until|use|void|wend|where|while)\b/i,
21+
function: /\b\w+(?=\()/,
22+
boolean: /\b(?:BBjAPI\.TRUE|BBjAPI\.FALSE)\b/i,
23+
operator: /<[=>]?|>=?|[+\-*\/^=&]|\b(?:and|not|or|xor)\b/i,
24+
punctuation: /[.,;:()]/
25+
}
26+
})(Prism)
27+
}

lang/bqn.js

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
// @ts-nocheck
2+
bqn.displayName = 'bqn'
3+
bqn.aliases = []
4+
5+
/** @type {import('../core.js').Syntax} */
6+
export default function bqn(Prism) {
7+
Prism.languages.bqn = {
8+
shebang: {
9+
pattern: /^#![ \t]*\/.*/,
10+
alias: 'important',
11+
greedy: true
12+
},
13+
comment: {
14+
pattern: /#.*/,
15+
greedy: true
16+
},
17+
'string-literal': {
18+
pattern: /"(?:[^"]|"")*"/,
19+
greedy: true,
20+
alias: 'string'
21+
},
22+
'character-literal': {
23+
pattern: /'(?:[\s\S]|[\uD800-\uDBFF][\uDC00-\uDFFF])'/,
24+
greedy: true,
25+
alias: 'char'
26+
},
27+
function: /[\w¯.π]+[\w¯.π]*/,
28+
'dot-notation-on-brackets': {
29+
pattern: /\{(?=.*\}\.)|\}\./,
30+
alias: 'namespace'
31+
},
32+
'special-name': {
33+
pattern: /(?:𝕨|𝕩|𝕗|𝕘|𝕤|𝕣|𝕎|𝕏|𝔽|𝔾|𝕊|_𝕣_|_𝕣)/,
34+
alias: 'keyword'
35+
},
36+
'dot-notation-on-name': {
37+
pattern: /[A-Za-z_][\w¯π]*\./,
38+
alias: 'namespace'
39+
},
40+
'word-number-scientific': {
41+
pattern: /\d+(?:\.\d+)?[eE]¯?\d+/,
42+
alias: 'number'
43+
},
44+
'word-name': {
45+
pattern: /[A-Za-z_][\w¯π]*/,
46+
alias: 'symbol'
47+
},
48+
'word-number': {
49+
pattern:
50+
/[¯π]?(?:\d*\.?\b\d+(?:e[+¯]?\d+|E[+¯]?\d+)?|¯||π)(?:j¯?(?:(?:\d+(?:\.\d+)?|\.\d+)(?:e[+¯]?\d+|E[+¯]?\d+)?|¯||π))?/,
51+
alias: 'number'
52+
},
53+
'null-literal': {
54+
pattern: /@/,
55+
alias: 'char'
56+
},
57+
'primitive-functions': {
58+
pattern: /[-+×÷|¬<>=«»/!]/,
59+
alias: 'operator'
60+
},
61+
'primitive-1-operators': {
62+
pattern: /[`˜˘¨´˝˙]/,
63+
alias: 'operator'
64+
},
65+
'primitive-2-operators': {
66+
pattern: /[]/,
67+
alias: 'operator'
68+
},
69+
punctuation: /[(){}[\]·,.;:?]/
70+
}
71+
}

lang/cilkc.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// @ts-nocheck
2+
import refractorC from './c.js'
3+
cilkc.displayName = 'cilkc'
4+
cilkc.aliases = ['cilk-c']
5+
6+
/** @type {import('../core.js').Syntax} */
7+
export default function cilkc(Prism) {
8+
Prism.register(refractorC)
9+
Prism.languages.cilkc = Prism.languages.insertBefore('c', 'function', {
10+
'parallel-keyword': {
11+
pattern: /\bcilk_(?:for|reducer|s(?:cope|pawn|ync))\b/,
12+
alias: 'keyword'
13+
}
14+
})
15+
Prism.languages['cilk-c'] = Prism.languages['cilkc']
16+
}

lang/cilkcpp.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// @ts-nocheck
2+
import refractorCpp from './cpp.js'
3+
cilkcpp.displayName = 'cilkcpp'
4+
cilkcpp.aliases = ['cilk', 'cilk-cpp']
5+
6+
/** @type {import('../core.js').Syntax} */
7+
export default function cilkcpp(Prism) {
8+
Prism.register(refractorCpp)
9+
Prism.languages.cilkcpp = Prism.languages.insertBefore('cpp', 'function', {
10+
'parallel-keyword': {
11+
pattern: /\bcilk_(?:for|reducer|s(?:cope|pawn|ync))\b/,
12+
alias: 'keyword'
13+
}
14+
})
15+
Prism.languages['cilk-cpp'] = Prism.languages['cilkcpp']
16+
Prism.languages['cilk'] = Prism.languages['cilkcpp']
17+
}

lang/css-extras.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export default function cssExtras(Prism) {
102102
color: [
103103
{
104104
pattern:
105-
/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,
105+
/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,
106106
lookbehind: true
107107
},
108108
{

lang/css.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,14 @@ export default function css(Prism) {
1010
Prism.languages.css = {
1111
comment: /\/\*[\s\S]*?\*\//,
1212
atrule: {
13-
pattern: /@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,
13+
pattern: RegExp(
14+
'@[\\w-](?:' +
15+
/[^;{\s"']|\s+(?!\s)/.source +
16+
'|' +
17+
string.source +
18+
')*?' +
19+
/(?:;|(?=\s*\{))/.source
20+
),
1421
inside: {
1522
rule: /^@[\w-]+/,
1623
'selector-function-argument': {

lang/gradle.js

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
// @ts-nocheck
2+
import refractorClike from './clike.js'
3+
gradle.displayName = 'gradle'
4+
gradle.aliases = []
5+
6+
/** @type {import('../core.js').Syntax} */
7+
export default function gradle(Prism) {
8+
Prism.register(refractorClike)
9+
;(function (Prism) {
10+
var interpolation = {
11+
pattern: /((?:^|[^\\$])(?:\\{2})*)\$(?:\w+|\{[^{}]*\})/,
12+
lookbehind: true,
13+
inside: {
14+
'interpolation-punctuation': {
15+
pattern: /^\$\{?|\}$/,
16+
alias: 'punctuation'
17+
},
18+
expression: {
19+
pattern: /[\s\S]+/,
20+
inside: null
21+
}
22+
}
23+
}
24+
Prism.languages.gradle = Prism.languages.extend('clike', {
25+
string: {
26+
pattern: /'''(?:[^\\]|\\[\s\S])*?'''|'(?:\\.|[^\\'\r\n])*'/,
27+
greedy: true
28+
},
29+
keyword:
30+
/\b(?:apply|def|dependencies|else|if|implementation|import|plugin|plugins|project|repositories|repository|sourceSets|tasks|val)\b/,
31+
number:
32+
/\b(?:0b[01_]+|0x[\da-f_]+(?:\.[\da-f_p\-]+)?|[\d_]+(?:\.[\d_]+)?(?:e[+-]?\d+)?)[glidf]?\b/i,
33+
operator: {
34+
pattern:
35+
/(^|[^.])(?:~|==?~?|\?[.:]?|\*(?:[.=]|\*=?)?|\.[@&]|\.\.<|\.\.(?!\.)|-[-=>]?|\+[+=]?|!=?|<(?:<=?|=>?)?|>(?:>>?=?|=)?|&[&=]?|\|[|=]?|\/=?|\^=?|%=?)/,
36+
lookbehind: true
37+
},
38+
punctuation: /\.+|[{}[\];(),:$]/
39+
})
40+
Prism.languages.insertBefore('gradle', 'string', {
41+
shebang: {
42+
pattern: /#!.+/,
43+
alias: 'comment',
44+
greedy: true
45+
},
46+
'interpolation-string': {
47+
pattern:
48+
/"""(?:[^\\]|\\[\s\S])*?"""|(["/])(?:\\.|(?!\1)[^\\\r\n])*\1|\$\/(?:[^/$]|\$(?:[/$]|(?![/$]))|\/(?!\$))*\/\$/,
49+
greedy: true,
50+
inside: {
51+
interpolation: interpolation,
52+
string: /[\s\S]+/
53+
}
54+
}
55+
})
56+
Prism.languages.insertBefore('gradle', 'punctuation', {
57+
'spock-block': /\b(?:and|cleanup|expect|given|setup|then|when|where):/
58+
})
59+
Prism.languages.insertBefore('gradle', 'function', {
60+
annotation: {
61+
pattern: /(^|[^.])@\w+/,
62+
lookbehind: true,
63+
alias: 'punctuation'
64+
}
65+
})
66+
interpolation.inside.expression.inside = Prism.languages.gradle
67+
})(Prism)
68+
}

lang/hoon.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default function hoon(Prism) {
1010
greedy: true
1111
},
1212
string: {
13-
pattern: /"[^"]*"|'[^']*'/,
13+
pattern: /"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'/,
1414
greedy: true
1515
},
1616
constant: /%(?:\.[ny]|[\w-]+)/,

lang/java.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ export default function java(Prism) {
7676
pattern:
7777
/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,
7878
lookbehind: true
79-
}
79+
},
80+
constant: /\b[A-Z][A-Z_\d]+\b/
8081
})
8182
Prism.languages.insertBefore('java', 'string', {
8283
'triple-quoted-string': {

lang/markup.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ export default function markup(Prism) {
5959
pattern: /^=/,
6060
alias: 'attr-equals'
6161
},
62-
/"|'/
62+
{
63+
pattern: /^(\s*)["']|["']$/,
64+
lookbehind: true
65+
}
6366
]
6467
}
6568
},

0 commit comments

Comments
 (0)