Skip to content

Commit

Permalink
JSON: Make strings greedy, remove negative look-ahead for ":". Fix #1204
Browse files Browse the repository at this point in the history
  • Loading branch information
Golmote committed Oct 21, 2017
1 parent de996d7 commit 98acd2d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion components/prism-json.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Prism.languages.json = {
'property': /"(?:\\.|[^\\"])*"(?=\s*:)/ig,
'string': /"(?!:)(?:\\.|[^\\"])*"(?!:)/g,
'string': {
pattern: /"(?:\\.|[^\\"])*"(?!:)/g,
greedy: true
},
'number': /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee][+-]?\d+)?)\b/g,
'punctuation': /[{}[\]);,]/g,
'operator': /:/g,
Expand Down
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 98acd2d

Please sign in to comment.