json.js 501 B

123456789101112131415161718
  1. // https://github.com/CupOfTea696/prism
  2. Prism.languages.json = {
  3. 'property': /"(\b|\B)[\w-]+"(?=\s*:)/ig,
  4. 'string': /"(?!:)(\\?[^'"])*?"(?!:)/g,
  5. 'number': /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/g,
  6. 'function': {
  7. pattern: /[a-z0-9_]+\(/ig,
  8. inside: {
  9. punctuation: /\(/
  10. }
  11. },
  12. 'punctuation': /[{}[\]);,]/g,
  13. 'operator': /:/g,
  14. 'boolean': /\b(true|false)\b/gi,
  15. 'null': /\bnull\b/gi,
  16. };
  17. Prism.languages.jsonp = Prism.languages.json;