Commit 51b1fd55468952d156cf7a8d45f7990f55e454c2

CupOfTea696 2014-09-22T13:23:45

regex fixes Suggested by owner in #369

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/components/prism-json.js b/components/prism-json.js
index cd623e9..d0fcb92 100644
--- a/components/prism-json.js
+++ b/components/prism-json.js
@@ -1,8 +1,8 @@
 Prism.languages.json = {
-    'property': /("|')(\b|\B)[\w-]+\1(?=\s*:)/ig,
+    'property': /"(\b|\B)[\w-]+"(?=\s*:)/ig,
     'number': /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/g,
-    'string': /("|')(?!:)(\\?[^'"])*?\1(?!:)/g,
+    'string': /"(?!:)(\\?[^'"])*?"(?!:)/g,
     'punctuation': /[\{\};:]/g,
-    'boolean': /\b(true|TRUE|false|FALSE)\b/g,
-    'null': /\b(null|NULL)\b/g,
+    'boolean': /\b(true|false)\b/gi,
+    'null': /\bnull\b/gi,
 };
\ No newline at end of file