Skip to content

Commit

Permalink
Cleaned up JSON (#1596)
Browse files Browse the repository at this point in the history
This PR removes useless flags (because JS is case sensitive, so is JSON)
and adds one to number to make the pattern more compact.
  • Loading branch information
RunDevelopment authored and mAAdhaTTah committed Oct 26, 2018
1 parent 8720b3e commit da474c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions components/prism-json.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
Prism.languages.json = {
'comment': /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,
'property': {
pattern: /"(?:\\.|[^\\"\r\n])*"(?=\s*:)/i,
pattern: /"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,
greedy: true
},
'string': {
pattern: /"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,
greedy: true
},
'number': /-?\d+\.?\d*([Ee][+-]?\d+)?/,
'number': /-?\d+\.?\d*(e[+-]?\d+)?/i,
'punctuation': /[{}[\],]/,
'operator': /:/g,
'boolean': /\b(?:true|false)\b/i,
'null': /\bnull\b/i
'operator': /:/,
'boolean': /\b(?:true|false)\b/,
'null': /\bnull\b/
};

Prism.languages.jsonp = Prism.languages.json;
2 changes: 1 addition & 1 deletion components/prism-json.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit da474c7

Please sign in to comment.