aboutsummaryrefslogtreecommitdiffstats
path: root/public/prism/prism-haml.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-haml.min.js
parentab355897a12b7bda1089a44de326d41455a0f7a3 (diff)
chore: add prismjs for syntax highlighting
Diffstat (limited to 'public/prism/prism-haml.min.js')
-rw-r--r--public/prism/prism-haml.min.js117
1 files changed, 117 insertions, 0 deletions
diff --git a/public/prism/prism-haml.min.js b/public/prism/prism-haml.min.js
new file mode 100644
index 0000000..45954d8
--- /dev/null
+++ b/public/prism/prism-haml.min.js
@@ -0,0 +1,117 @@
+!(function (n) {
+ n.languages.haml = {
+ 'multiline-comment': {
+ pattern: /((?:^|\r?\n|\r)([\t ]*))(?:\/|-#).*(?:(?:\r?\n|\r)\2[\t ].+)*/,
+ lookbehind: !0,
+ alias: 'comment',
+ },
+ 'multiline-code': [
+ {
+ pattern:
+ /((?:^|\r?\n|\r)([\t ]*)(?:[~-]|[&!]?=)).*,[\t ]*(?:(?:\r?\n|\r)\2[\t ].*,[\t ]*)*(?:(?:\r?\n|\r)\2[\t ].+)/,
+ lookbehind: !0,
+ inside: n.languages.ruby,
+ },
+ {
+ pattern:
+ /((?:^|\r?\n|\r)([\t ]*)(?:[~-]|[&!]?=)).*\|[\t ]*(?:(?:\r?\n|\r)\2[\t ].*\|[\t ]*)*/,
+ lookbehind: !0,
+ inside: n.languages.ruby,
+ },
+ ],
+ filter: {
+ pattern:
+ /((?:^|\r?\n|\r)([\t ]*)):[\w-]+(?:(?:\r?\n|\r)(?:\2[\t ].+|\s*?(?=\r?\n|\r)))+/,
+ lookbehind: !0,
+ inside: { 'filter-name': { pattern: /^:[\w-]+/, alias: 'symbol' } },
+ },
+ markup: {
+ pattern: /((?:^|\r?\n|\r)[\t ]*)<.+/,
+ lookbehind: !0,
+ inside: n.languages.markup,
+ },
+ doctype: { pattern: /((?:^|\r?\n|\r)[\t ]*)!!!(?: .+)?/, lookbehind: !0 },
+ tag: {
+ pattern:
+ /((?:^|\r?\n|\r)[\t ]*)[%.#][\w\-#.]*[\w\-](?:\([^)]+\)|\{(?:\{[^}]+\}|[^{}])+\}|\[[^\]]+\])*[\/<>]*/,
+ lookbehind: !0,
+ inside: {
+ attributes: [
+ {
+ pattern: /(^|[^#])\{(?:\{[^}]+\}|[^{}])+\}/,
+ lookbehind: !0,
+ inside: n.languages.ruby,
+ },
+ {
+ pattern: /\([^)]+\)/,
+ inside: {
+ 'attr-value': {
+ pattern: /(=\s*)(?:"(?:\\.|[^\\"\r\n])*"|[^)\s]+)/,
+ lookbehind: !0,
+ },
+ 'attr-name': /[\w:-]+(?=\s*!?=|\s*[,)])/,
+ punctuation: /[=(),]/,
+ },
+ },
+ { pattern: /\[[^\]]+\]/, inside: n.languages.ruby },
+ ],
+ punctuation: /[<>]/,
+ },
+ },
+ code: {
+ pattern: /((?:^|\r?\n|\r)[\t ]*(?:[~-]|[&!]?=)).+/,
+ lookbehind: !0,
+ inside: n.languages.ruby,
+ },
+ interpolation: {
+ pattern: /#\{[^}]+\}/,
+ inside: {
+ delimiter: { pattern: /^#\{|\}$/, alias: 'punctuation' },
+ ruby: { pattern: /[\s\S]+/, inside: n.languages.ruby },
+ },
+ },
+ punctuation: { pattern: /((?:^|\r?\n|\r)[\t ]*)[~=\-&!]+/, lookbehind: !0 },
+ };
+ for (
+ var e = [
+ 'css',
+ { filter: 'coffee', language: 'coffeescript' },
+ 'erb',
+ 'javascript',
+ 'less',
+ 'markdown',
+ 'ruby',
+ 'scss',
+ 'textile',
+ ],
+ t = {},
+ r = 0,
+ a = e.length;
+ r < a;
+ r++
+ ) {
+ var i = e[r];
+ (i = 'string' == typeof i ? { filter: i, language: i } : i),
+ n.languages[i.language] &&
+ (t['filter-' + i.filter] = {
+ pattern: RegExp(
+ '((?:^|\\r?\\n|\\r)([\\t ]*)):{{filter_name}}(?:(?:\\r?\\n|\\r)(?:\\2[\\t ].+|\\s*?(?=\\r?\\n|\\r)))+'.replace(
+ '{{filter_name}}',
+ function () {
+ return i.filter;
+ }
+ )
+ ),
+ lookbehind: !0,
+ inside: {
+ 'filter-name': { pattern: /^:[\w-]+/, alias: 'symbol' },
+ text: {
+ pattern: /[\s\S]+/,
+ alias: [i.language, 'language-' + i.language],
+ inside: n.languages[i.language],
+ },
+ },
+ });
+ }
+ n.languages.insertBefore('haml', 'filter', t);
+})(Prism);