From a98b5ea6fe8e8cc98a55e0fd793e6e8660ea31c1 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Thu, 30 Dec 2021 19:47:21 +0100 Subject: chore: add prismjs for syntax highlighting --- public/prism/prism-toml.min.js | 45 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 public/prism/prism-toml.min.js (limited to 'public/prism/prism-toml.min.js') diff --git a/public/prism/prism-toml.min.js b/public/prism/prism-toml.min.js new file mode 100644 index 0000000..40a88d9 --- /dev/null +++ b/public/prism/prism-toml.min.js @@ -0,0 +1,45 @@ +!(function (e) { + function n(e) { + return e.replace(/__/g, function () { + return '(?:[\\w-]+|\'[^\'\n\r]*\'|"(?:\\\\.|[^\\\\"\r\n])*")'; + }); + } + e.languages.toml = { + comment: { pattern: /#.*/, greedy: !0 }, + table: { + pattern: RegExp( + n('(^[\t ]*\\[\\s*(?:\\[\\s*)?)__(?:\\s*\\.\\s*__)*(?=\\s*\\])'), + 'm' + ), + lookbehind: !0, + greedy: !0, + alias: 'class-name', + }, + key: { + pattern: RegExp( + n('(^[\t ]*|[{,]\\s*)__(?:\\s*\\.\\s*__)*(?=\\s*=)'), + 'm' + ), + lookbehind: !0, + greedy: !0, + alias: 'property', + }, + string: { + pattern: + /"""(?:\\[\s\S]|[^\\])*?"""|'''[\s\S]*?'''|'[^'\n\r]*'|"(?:\\.|[^\\"\r\n])*"/, + greedy: !0, + }, + date: [ + { + pattern: + /\b\d{4}-\d{2}-\d{2}(?:[T\s]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})?)?\b/i, + alias: 'number', + }, + { pattern: /\b\d{2}:\d{2}:\d{2}(?:\.\d+)?\b/, alias: 'number' }, + ], + number: + /(?:\b0(?:x[\da-zA-Z]+(?:_[\da-zA-Z]+)*|o[0-7]+(?:_[0-7]+)*|b[10]+(?:_[10]+)*))\b|[-+]?\b\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?\b|[-+]?\b(?:inf|nan)\b/, + boolean: /\b(?:false|true)\b/, + punctuation: /[.,=[\]{}]/, + }; +})(Prism); -- cgit v1.2.3