Skip to content

Commit

Permalink
JSON: Fixed backtracking issue in Safari (#2691)
Browse files Browse the repository at this point in the history
  • Loading branch information
RunDevelopment committed Jan 3, 2021
1 parent 1506f34 commit cf28d1b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions components/prism-json.js
@@ -1,11 +1,13 @@
// https://www.json.org/json-en.html
Prism.languages.json = {
'property': {
pattern: /"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,
pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,
lookbehind: true,
greedy: true
},
'string': {
pattern: /"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,
pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,
lookbehind: true,
greedy: true
},
'comment': {
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 cf28d1b

Please sign in to comment.