From eee066499dfd622f80c325dbbf3c6276a920beca Mon Sep 17 00:00:00 2001 From: ExE Boss <3889017+ExE-Boss@users.noreply.github.com> Date: Thu, 14 Feb 2019 01:18:46 +0100 Subject: [PATCH] =?UTF-8?q?Added=20`keyword`=20alias=20to=20JSON's=C2=A0`n?= =?UTF-8?q?ull`=20(#1733)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This adds the `keyword` alias to the `null` pattern in JSON. --- components/prism-json.js | 5 ++++- components/prism-json.min.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/components/prism-json.js b/components/prism-json.js index 6ae91b4c13..70f0622b8e 100644 --- a/components/prism-json.js +++ b/components/prism-json.js @@ -12,7 +12,10 @@ Prism.languages.json = { 'punctuation': /[{}[\],]/, 'operator': /:/, 'boolean': /\b(?:true|false)\b/, - 'null': /\bnull\b/ + 'null': { + pattern: /\bnull\b/, + alias: 'keyword' + } }; Prism.languages.jsonp = Prism.languages.json; diff --git a/components/prism-json.min.js b/components/prism-json.min.js index 4c3c1faab4..2dfd523497 100644 --- a/components/prism-json.min.js +++ b/components/prism-json.min.js @@ -1 +1 @@ -Prism.languages.json={comment:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,property:{pattern:/"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,greedy:!0},string:{pattern:/"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,greedy:!0},number:/-?\d+\.?\d*(e[+-]?\d+)?/i,punctuation:/[{}[\],]/,operator:/:/,"boolean":/\b(?:true|false)\b/,"null":/\bnull\b/},Prism.languages.jsonp=Prism.languages.json; \ No newline at end of file +Prism.languages.json={comment:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,property:{pattern:/"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,greedy:!0},string:{pattern:/"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,greedy:!0},number:/-?\d+\.?\d*(e[+-]?\d+)?/i,punctuation:/[{}[\],]/,operator:/:/,"boolean":/\b(?:true|false)\b/,"null":{pattern:/\bnull\b/,alias:"keyword"}},Prism.languages.jsonp=Prism.languages.json; \ No newline at end of file