diff options
| author | Armand Philippot <git@armandphilippot.com> | 2021-12-30 19:47:21 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2021-12-30 19:47:21 +0100 |
| commit | a98b5ea6fe8e8cc98a55e0fd793e6e8660ea31c1 (patch) | |
| tree | 542810ab5aef99150db228bb54fd58303dcb31c7 /public/prism/prism-velocity.min.js | |
| parent | ab355897a12b7bda1089a44de326d41455a0f7a3 (diff) | |
chore: add prismjs for syntax highlighting
Diffstat (limited to 'public/prism/prism-velocity.min.js')
| -rw-r--r-- | public/prism/prism-velocity.min.js | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/public/prism/prism-velocity.min.js b/public/prism/prism-velocity.min.js new file mode 100644 index 0000000..b7b5b1b --- /dev/null +++ b/public/prism/prism-velocity.min.js @@ -0,0 +1,60 @@ +!(function (e) { + e.languages.velocity = e.languages.extend('markup', {}); + var n = { + variable: { + pattern: + /(^|[^\\](?:\\\\)*)\$!?(?:[a-z][\w-]*(?:\([^)]*\))?(?:\.[a-z][\w-]*(?:\([^)]*\))?|\[[^\]]+\])*|\{[^}]+\})/i, + lookbehind: !0, + inside: {}, + }, + string: { pattern: /"[^"]*"|'[^']*'/, greedy: !0 }, + number: /\b\d+\b/, + boolean: /\b(?:false|true)\b/, + operator: /[=!<>]=?|[+*/%-]|&&|\|\||\.\.|\b(?:eq|g[et]|l[et]|n(?:e|ot))\b/, + punctuation: /[(){}[\]:,.]/, + }; + (n.variable.inside = { + string: n.string, + function: { pattern: /([^\w-])[a-z][\w-]*(?=\()/, lookbehind: !0 }, + number: n.number, + boolean: n.boolean, + punctuation: n.punctuation, + }), + e.languages.insertBefore('velocity', 'comment', { + unparsed: { + pattern: /(^|[^\\])#\[\[[\s\S]*?\]\]#/, + lookbehind: !0, + greedy: !0, + inside: { punctuation: /^#\[\[|\]\]#$/ }, + }, + 'velocity-comment': [ + { + pattern: /(^|[^\\])#\*[\s\S]*?\*#/, + lookbehind: !0, + greedy: !0, + alias: 'comment', + }, + { + pattern: /(^|[^\\])##.*/, + lookbehind: !0, + greedy: !0, + alias: 'comment', + }, + ], + directive: { + pattern: + /(^|[^\\](?:\\\\)*)#@?(?:[a-z][\w-]*|\{[a-z][\w-]*\})(?:\s*\((?:[^()]|\([^()]*\))*\))?/i, + lookbehind: !0, + inside: { + keyword: { + pattern: /^#@?(?:[a-z][\w-]*|\{[a-z][\w-]*\})|\bin\b/, + inside: { punctuation: /[{}]/ }, + }, + rest: n, + }, + }, + variable: n.variable, + }), + (e.languages.velocity.tag.inside['attr-value'].inside.rest = + e.languages.velocity); +})(Prism); |
