CS-Notes/docs/_style/prism-master/components/prism-json.js

19 lines
413 B
Java
Raw Normal View History

2018-12-19 14:09:39 +08:00
Prism.languages.json = {
'comment': /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,
'property': {
pattern: /"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,
greedy: true
},
'string': {
pattern: /"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,
greedy: true
},
'number': /-?\d+\.?\d*(e[+-]?\d+)?/i,
'punctuation': /[{}[\],]/,
'operator': /:/,
'boolean': /\b(?:true|false)\b/,
'null': /\bnull\b/
};
Prism.languages.jsonp = Prism.languages.json;