OLD | NEW |
1 Prism.languages.javascript = Prism.languages.extend('clike', { | 1 Prism.languages.javascript = Prism.languages.extend('clike', { |
2 'keyword': /\b(as|async|await|break|case|catch|class|const|continue|debu
gger|default|delete|do|else|enum|export|extends|false|finally|for|from|function|
get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private
|protected|public|return|set|static|super|switch|this|throw|true|try|typeof|var|
void|while|with|yield)\b/, | 2 'keyword': /\b(as|async|await|break|case|catch|class|const|continue|debu
gger|default|delete|do|else|enum|export|extends|false|finally|for|from|function|
get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private
|protected|public|return|set|static|super|switch|this|throw|true|try|typeof|var|
void|while|with|yield)\b/, |
3 'number': /\b-?(0x[\dA-Fa-f]+|0b[01]+|0o[0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|
NaN|Infinity)\b/, | 3 'number': /\b-?(0x[\dA-Fa-f]+|0b[01]+|0o[0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|
NaN|Infinity)\b/, |
4 » 'function': /(?!\d)[a-z0-9_$]+(?=\()/i | 4 » // Allow for all non-ASCII characters (See http://stackoverflow.com/a/20
08444) |
| 5 » 'function': /[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/i |
5 }); | 6 }); |
6 | 7 |
7 Prism.languages.insertBefore('javascript', 'keyword', { | 8 Prism.languages.insertBefore('javascript', 'keyword', { |
8 'regex': { | 9 'regex': { |
9 pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\\\r\n])+\/[gimyu]{0,5}
(?=\s*($|[\r\n,.;})]))/, | 10 pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\\\r\n])+\/[gimyu]{0,5}
(?=\s*($|[\r\n,.;})]))/, |
10 lookbehind: true | 11 lookbehind: true |
11 } | 12 } |
12 }); | 13 }); |
13 | 14 |
14 Prism.languages.insertBefore('javascript', 'class-name', { | 15 Prism.languages.insertBefore('javascript', 'class-name', { |
(...skipping 11 matching lines...) Expand all Loading... |
26 } | 27 } |
27 }, | 28 }, |
28 'string': /[\s\S]+/ | 29 'string': /[\s\S]+/ |
29 } | 30 } |
30 } | 31 } |
31 }); | 32 }); |
32 | 33 |
33 if (Prism.languages.markup) { | 34 if (Prism.languages.markup) { |
34 Prism.languages.insertBefore('markup', 'tag', { | 35 Prism.languages.insertBefore('markup', 'tag', { |
35 'script': { | 36 'script': { |
36 » » » pattern: /<script[\w\W]*?>[\w\W]*?<\/script>/i, | 37 » » » pattern: /(<script[\w\W]*?>)[\w\W]*?(?=<\/script>)/i, |
37 » » » inside: { | 38 » » » lookbehind: true, |
38 » » » » 'tag': { | 39 » » » inside: Prism.languages.javascript, |
39 » » » » » pattern: /<script[\w\W]*?>|<\/script>/i, | |
40 » » » » » inside: Prism.languages.markup.tag.insid
e | |
41 » » » » }, | |
42 » » » » rest: Prism.languages.javascript | |
43 » » » }, | |
44 alias: 'language-javascript' | 40 alias: 'language-javascript' |
45 } | 41 } |
46 }); | 42 }); |
47 } | 43 } |
| 44 |
| 45 Prism.languages.js = Prism.languages.javascript; |
OLD | NEW |