diff options
| author | shu <nvcsadjkojf@outlook.com> | 2026-08-19 15:56:06 +0800 |
|---|---|---|
| committer | shu <nvcsadjkojf@outlook.com> | 2026-08-19 15:56:06 +0800 |
| commit | ca1a4a31706d0c03673fe4c414c645ed826b21c6 (patch) | |
| tree | c412265a19dd4694c39aac65b6e1a8903a513978 /plugins/utilities/highlight-json5.tid | |
| parent | 490d41f154615a52734f117d7d7bda5a9331e303 (diff) | |
精简 Wiki 构建与运行方式
将浏览器端工具整理为 utilities 插件,移除 Docker、Org GTD 和 files API,并补充单文件构建及 Node.js 运行入口。
Diffstat (limited to 'plugins/utilities/highlight-json5.tid')
| -rw-r--r-- | plugins/utilities/highlight-json5.tid | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/plugins/utilities/highlight-json5.tid b/plugins/utilities/highlight-json5.tid new file mode 100644 index 0000000..fae9bd4 --- /dev/null +++ b/plugins/utilities/highlight-json5.tid @@ -0,0 +1,59 @@ +title: $:/plugins/local/highlight-languages/json5.js +type: application/javascript +module-type: highlight + +/*\ +title: $:/plugins/local/highlight-languages/json5.js +type: application/javascript +module-type: highlight + +JSON5 language definition for highlight.js. +\*/ +"use strict"; + +hljs.registerLanguage("json5",function(hljs) { + return { + name: "JSON5", + aliases: ["json5"], + keywords: { + literal: "true false null" + }, + contains: [ + hljs.C_LINE_COMMENT_MODE, + hljs.C_BLOCK_COMMENT_MODE, + { + className: "attr", + match: /[A-Za-z_$][0-9A-Za-z_$]*(?=\s*:)/ + }, + { + className: "attr", + match: /"(?:\\.|[^"\\\r\n])*"(?=\s*:)/ + }, + { + className: "attr", + match: /'(?:\\.|[^'\\\r\n])*'(?=\s*:)/ + }, + hljs.QUOTE_STRING_MODE, + hljs.APOS_STRING_MODE, + { + className: "number", + variants: [ + { + begin: /[+-]?(?:Infinity|NaN)\b/ + }, + { + begin: /[+-]?0[xX][0-9a-fA-F]+\b/ + }, + { + begin: /[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?/ + } + ], + relevance: 0 + }, + { + className: "punctuation", + match: /[{}\[\],:]/ + } + ] + }; +}); |
