aboutsummaryrefslogtreecommitdiffstats
path: root/public/prism/prism-soy.min.js
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2021-12-30 19:47:21 +0100
committerArmand Philippot <git@armandphilippot.com>2021-12-30 19:47:21 +0100
commita98b5ea6fe8e8cc98a55e0fd793e6e8660ea31c1 (patch)
tree542810ab5aef99150db228bb54fd58303dcb31c7 /public/prism/prism-soy.min.js
parentab355897a12b7bda1089a44de326d41455a0f7a3 (diff)
chore: add prismjs for syntax highlighting
Diffstat (limited to 'public/prism/prism-soy.min.js')
-rw-r--r--public/prism/prism-soy.min.js63
1 files changed, 63 insertions, 0 deletions
diff --git a/public/prism/prism-soy.min.js b/public/prism/prism-soy.min.js
new file mode 100644
index 0000000..22f1d2a
--- /dev/null
+++ b/public/prism/prism-soy.min.js
@@ -0,0 +1,63 @@
+!(function (t) {
+ var e = /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
+ a = /\b\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b|\b0x[\dA-F]+\b/;
+ (t.languages.soy = {
+ comment: [
+ /\/\*[\s\S]*?\*\//,
+ { pattern: /(\s)\/\/.*/, lookbehind: !0, greedy: !0 },
+ ],
+ 'command-arg': {
+ pattern:
+ /(\{+\/?\s*(?:alias|call|delcall|delpackage|deltemplate|namespace|template)\s+)\.?[\w.]+/,
+ lookbehind: !0,
+ alias: 'string',
+ inside: { punctuation: /\./ },
+ },
+ parameter: {
+ pattern: /(\{+\/?\s*@?param\??\s+)\.?[\w.]+/,
+ lookbehind: !0,
+ alias: 'variable',
+ },
+ keyword: [
+ {
+ pattern:
+ /(\{+\/?[^\S\r\n]*)(?:\\[nrt]|alias|call|case|css|default|delcall|delpackage|deltemplate|else(?:if)?|fallbackmsg|for(?:each)?|if(?:empty)?|lb|let|literal|msg|namespace|nil|@?param\??|rb|sp|switch|template|xid)/,
+ lookbehind: !0,
+ },
+ /\b(?:any|as|attributes|bool|css|float|html|in|int|js|list|map|null|number|string|uri)\b/,
+ ],
+ delimiter: { pattern: /^\{+\/?|\/?\}+$/, alias: 'punctuation' },
+ property: /\w+(?==)/,
+ variable: {
+ pattern: /\$[^\W\d]\w*(?:\??(?:\.\w+|\[[^\]]+\]))*/,
+ inside: {
+ string: { pattern: e, greedy: !0 },
+ number: a,
+ punctuation: /[\[\].?]/,
+ },
+ },
+ string: { pattern: e, greedy: !0 },
+ function: [/\w+(?=\()/, { pattern: /(\|[^\S\r\n]*)\w+/, lookbehind: !0 }],
+ boolean: /\b(?:false|true)\b/,
+ number: a,
+ operator: /\?:?|<=?|>=?|==?|!=|[+*/%-]|\b(?:and|not|or)\b/,
+ punctuation: /[{}()\[\]|.,:]/,
+ }),
+ t.hooks.add('before-tokenize', function (e) {
+ var a = !1;
+ t.languages['markup-templating'].buildPlaceholders(
+ e,
+ 'soy',
+ /\{\{.+?\}\}|\{.+?\}|\s\/\/.*|\/\*[\s\S]*?\*\//g,
+ function (e) {
+ return (
+ '{/literal}' === e && (a = !1),
+ !a && ('{literal}' === e && (a = !0), !0)
+ );
+ }
+ );
+ }),
+ t.hooks.add('after-tokenize', function (e) {
+ t.languages['markup-templating'].tokenizePlaceholders(e, 'soy');
+ });
+})(Prism);