9 lines
590 B
JavaScript
9 lines
590 B
JavaScript
hljs.registerLanguage("json",(()=>{"use strict";return n=>{const e={
|
|
literal:"true false null"
|
|
},i=[n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE],a=[n.QUOTE_STRING_MODE,n.C_NUMBER_MODE],l={
|
|
end:",",endsWithParent:!0,excludeEnd:!0,contains:a,keywords:e},t={begin:/\{/,
|
|
end:/\}/,contains:[{className:"attr",begin:/"/,end:/"/,
|
|
contains:[n.BACKSLASH_ESCAPE],illegal:"\\n"},n.inherit(l,{begin:/:/
|
|
})].concat(i),illegal:"\\S"},s={begin:"\\[",end:"\\]",contains:[n.inherit(l)],
|
|
illegal:"\\S"};return a.push(t,s),i.forEach((n=>{a.push(n)})),{name:"JSON",
|
|
contains:a,keywords:e,illegal:"\\S"}}})()); |