UNPKG

refractor

Version:

Lightweight, robust, elegant virtual syntax highlighting using Prism

21 lines (19 loc) 507 B
'use strict'; module.exports = json; json.displayName = 'json'; json.aliases = ['jsonp']; function json(Prism) { Prism.languages.json = { property: /"(?:\\.|[^\\"\r\n])*"(?=\s*:)/i, string: { pattern: /"(?:\\.|[^\\"\r\n])*"(?!\s*:)/, greedy: true }, number: /\b-?(?:0x[\dA-Fa-f]+|\d*\.?\d+(?:[Ee][+-]?\d+)?)\b/, punctuation: /[{}[\]);,]/, operator: /:/g, boolean: /\b(?:true|false)\b/i, null: /\bnull\b/i }; Prism.languages.jsonp = Prism.languages.json; }