From 7a3df06eb573d36142bd1a8e03c5ce8752d300b3 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 24 May 2017 15:10:37 +0200 Subject: fix build issues and add typedoc --- node_modules/highlight.js/lib/languages/json.js | 36 +++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 node_modules/highlight.js/lib/languages/json.js (limited to 'node_modules/highlight.js/lib/languages/json.js') diff --git a/node_modules/highlight.js/lib/languages/json.js b/node_modules/highlight.js/lib/languages/json.js new file mode 100644 index 000000000..6e5cb6334 --- /dev/null +++ b/node_modules/highlight.js/lib/languages/json.js @@ -0,0 +1,36 @@ +module.exports = function(hljs) { + var LITERALS = {literal: 'true false null'}; + var TYPES = [ + hljs.QUOTE_STRING_MODE, + hljs.C_NUMBER_MODE + ]; + var VALUE_CONTAINER = { + end: ',', endsWithParent: true, excludeEnd: true, + contains: TYPES, + keywords: LITERALS + }; + var OBJECT = { + begin: '{', end: '}', + contains: [ + { + className: 'attr', + begin: /"/, end: /"/, + contains: [hljs.BACKSLASH_ESCAPE], + illegal: '\\n', + }, + hljs.inherit(VALUE_CONTAINER, {begin: /:/}) + ], + illegal: '\\S' + }; + var ARRAY = { + begin: '\\[', end: '\\]', + contains: [hljs.inherit(VALUE_CONTAINER)], // inherit is a workaround for a bug that makes shared modes with endsWithParent compile only the ending of one of the parents + illegal: '\\S' + }; + TYPES.splice(TYPES.length, 0, OBJECT, ARRAY); + return { + contains: TYPES, + keywords: LITERALS, + illegal: '\\S' + }; +}; \ No newline at end of file -- cgit v1.2.3