]>
luflow.net public git repositories - flow-web.git/blob - static/highlight/languages/json.js
1 /*! `json` grammar compiled for Highlight.js 11.11.1 */
3 var hljsGrammar
= (function () {
8 Description: JSON (JavaScript Object Notation) is a lightweight data-interchange format.
9 Author: Ivan Sagalaev <maniac@softwaremaniacs.org>
10 Website: http://www.json.org
11 Category: common, protocols, web
17 begin: /"(\\.|[^\\"\r\n])*"(?=\s*:)/,
22 className: "punctuation",
30 // NOTE: normally we would rely on `keywords` for this but using a mode here allows us
31 // - to use the very tight `illegal: \S` rule later to flag any other character
32 // - as illegal indicating that despite looking like JSON we do not truly have
33 // - JSON and thus improve false-positively greatly since JSON will try and claim
34 // - all sorts of JSON looking stuff
35 const LITERALS_MODE
= {
37 beginKeywords: LITERALS
.join(" "),
49 hljs
.QUOTE_STRING_MODE
,
52 hljs
.C_LINE_COMMENT_MODE
,
53 hljs
.C_BLOCK_COMMENT_MODE
63 hljs
.registerLanguage('json', hljsGrammar
);