Commit 8a8f6a0ac46af2bcb4aa1a972e253147859a9092

CupOfTea696 2014-09-22T02:03:23

JSON Language Added JSON support to prism.

diff --git a/components/prism-json.js b/components/prism-json.js
new file mode 100644
index 0000000..5fdf90e
--- /dev/null
+++ b/components/prism-json.js
@@ -0,0 +1,8 @@
+Prism.languages.json = {
+	'property': /(\b|\B)[\w-]+(?=\s*:)/ig,
+    'number': /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/g,
+	'string': /("|')(?!:)(\\?[^'"])*?\1(?!:)/g,
+	'punctuation': /[\{\};:]/g,
+    'boolean': /\b(true|TRUE|false|FALSE)\b/g,
+	'null': /\b(null|NULL)\b/g,
+};
\ No newline at end of file
diff --git a/components/prism-json.min.js b/components/prism-json.min.js
new file mode 100644
index 0000000..2b02e51
--- /dev/null
+++ b/components/prism-json.min.js
@@ -0,0 +1 @@
+Prism.languages.json={property:/(\b|\B)[\w-]+(?=\s*:)/gi,number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/g,string:/("|')(?!:)(\\?[^'"])*?\1(?!:)/g,punctuation:/[\{\};:]/g,"boolean":/\b(true|TRUE|false|FALSE)\b/g,"null":/\b(null|NULL)\b/g};
\ No newline at end of file