summaryrefslogtreecommitdiffstats
path: root/public/prism/prism-markup-templating.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-markup-templating.min.js
parentab355897a12b7bda1089a44de326d41455a0f7a3 (diff)
chore: add prismjs for syntax highlighting
Diffstat (limited to 'public/prism/prism-markup-templating.min.js')
-rw-r--r--public/prism/prism-markup-templating.min.js64
1 files changed, 64 insertions, 0 deletions
diff --git a/public/prism/prism-markup-templating.min.js b/public/prism/prism-markup-templating.min.js
new file mode 100644
index 0000000..43488c9
--- /dev/null
+++ b/public/prism/prism-markup-templating.min.js
@@ -0,0 +1,64 @@
+!(function (h) {
+ function v(e, n) {
+ return '___' + e.toUpperCase() + n + '___';
+ }
+ Object.defineProperties((h.languages['markup-templating'] = {}), {
+ buildPlaceholders: {
+ value: function (a, r, e, o) {
+ if (a.language === r) {
+ var c = (a.tokenStack = []);
+ (a.code = a.code.replace(e, function (e) {
+ if ('function' == typeof o && !o(e)) return e;
+ for (var n, t = c.length; -1 !== a.code.indexOf((n = v(r, t))); )
+ ++t;
+ return (c[t] = e), n;
+ })),
+ (a.grammar = h.languages.markup);
+ }
+ },
+ },
+ tokenizePlaceholders: {
+ value: function (p, k) {
+ if (p.language === k && p.tokenStack) {
+ p.grammar = h.languages[k];
+ var m = 0,
+ d = Object.keys(p.tokenStack);
+ !(function e(n) {
+ for (var t = 0; t < n.length && !(m >= d.length); t++) {
+ var a = n[t];
+ if (
+ 'string' == typeof a ||
+ (a.content && 'string' == typeof a.content)
+ ) {
+ var r = d[m],
+ o = p.tokenStack[r],
+ c = 'string' == typeof a ? a : a.content,
+ i = v(k, r),
+ u = c.indexOf(i);
+ if (-1 < u) {
+ ++m;
+ var g = c.substring(0, u),
+ l = new h.Token(
+ k,
+ h.tokenize(o, p.grammar),
+ 'language-' + k,
+ o
+ ),
+ s = c.substring(u + i.length),
+ f = [];
+ g && f.push.apply(f, e([g])),
+ f.push(l),
+ s && f.push.apply(f, e([s])),
+ 'string' == typeof a
+ ? n.splice.apply(n, [t, 1].concat(f))
+ : (a.content = f);
+ }
+ } else a.content && e(a.content);
+ }
+ return n;
+ })(p.tokens);
+ }
+ },
+ },
+ });
+})(Prism);