mirror of
https://github.com/Funkoala14/knowledgebase_law.git
synced 2025-06-09 05:58:15 +08:00
34 lines
775 B
JavaScript
34 lines
775 B
JavaScript
'use strict'
|
|
|
|
module.exports = json
|
|
json.displayName = 'json'
|
|
json.aliases = ['webmanifest']
|
|
function json(Prism) {
|
|
// https://www.json.org/json-en.html
|
|
Prism.languages.json = {
|
|
property: {
|
|
pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,
|
|
lookbehind: true,
|
|
greedy: true
|
|
},
|
|
string: {
|
|
pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,
|
|
lookbehind: true,
|
|
greedy: true
|
|
},
|
|
comment: {
|
|
pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,
|
|
greedy: true
|
|
},
|
|
number: /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
|
|
punctuation: /[{}[\],]/,
|
|
operator: /:/,
|
|
boolean: /\b(?:false|true)\b/,
|
|
null: {
|
|
pattern: /\bnull\b/,
|
|
alias: 'keyword'
|
|
}
|
|
}
|
|
Prism.languages.webmanifest = Prism.languages.json
|
|
}
|