From ad2fcd01984ba0aae3744be0c60244a424617078 Mon Sep 17 00:00:00 2001 From: CupOfTea696 Date: Tue, 29 Dec 2015 15:54:51 +0000 Subject: [PATCH] JSON Fixes --- components.js | 2 +- components/prism-json.js | 10 ++-------- components/prism-json.min.js | 3 +-- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/components.js b/components.js index 61316cf932..a748628689 100644 --- a/components.js +++ b/components.js @@ -184,7 +184,7 @@ var components = { "json": { "title": "JSON", "option": "default", - "owner": "CupOfTea696" + "owner": "CupOfTea696" }, "julia": { "title": "Julia", diff --git a/components/prism-json.js b/components/prism-json.js index 979c21afb7..c7634b18ec 100644 --- a/components/prism-json.js +++ b/components/prism-json.js @@ -1,13 +1,7 @@ Prism.languages.json = { - 'property': /"(\b|\B)[\w-]+"(?=\s*:)/ig, - 'string': /"(?!:)(\\?[^'"])*?"(?!:)/g, + 'property': /".*?"(?=\s*:)/ig, + 'string': /"(?!:)(\\?[^"])*?"(?!:)/g, 'number': /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/g, - 'function': { - pattern: /[a-z0-9_]+\(/ig, - inside: { - punctuation: /\(/ - } - }, 'punctuation': /[{}[\]);,]/g, 'operator': /:/g, 'boolean': /\b(true|false)\b/gi, diff --git a/components/prism-json.min.js b/components/prism-json.min.js index 7b92d09a20..adf940323e 100644 --- a/components/prism-json.min.js +++ b/components/prism-json.min.js @@ -1,2 +1 @@ -Prism.languages.json={property:/"(\b|\B)[\w-]+"(?=\s*:)/gi,string:/"(?!:)(\\?[^'"])*?"(?!:)/g,number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/g,"function":{pattern:/[a-z0-9_]+\(/gi,inside:{punctuation:/\(/}},punctuation:/[{}[\]);,]/g,operator:/:/g,"boolean":/\b(true|false)\b/gi,"null":/\bnull\b/gi},Prism.languages.jsonp=Prism.languages.json; -//# sourceMappingURL=./prism-json.min.js.map \ No newline at end of file +Prism.languages.json={property:/".*?"(?=\s*:)/gi,string:/"(?!:)(\\?[^"])*?"(?!:)/g,number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/g,punctuation:/[{}[\]);,]/g,operator:/:/g,"boolean":/\b(true|false)\b/gi,"null":/\bnull\b/gi},Prism.languages.jsonp=Prism.languages.json; \ No newline at end of file