summaryrefslogtreecommitdiffstats
path: root/public/prism/prism-ftl.min.js
blob: 2b1df405e19f3064ed984671d757c5d7f87f5060 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0066bb; fon
!(function (n) {
  for (
    var i =
        '[^<()"\']|\\((?:<expr>)*\\)|<(?!#--)|<#--(?:[^-]|-(?!->))*--\x3e|"(?:[^\\\\"]|\\\\.)*"|\'(?:[^\\\\\']|\\\\.)*\'',
      e = 0;
    e < 2;
    e++
  )
    i = i.replace(/<expr>/g, function () {
      return i;
    });
  i = i.replace(/<expr>/g, '[^\\s\\S]');
  var t = {
    comment: /<#--[\s\S]*?-->/,
    string: [
      { pattern: /\br("|')(?:(?!\1)[^\\]|\\.)*\1/, greedy: !0 },
      {
        pattern: RegExp(
          '("|\')(?:(?!\\1|\\$\\{)[^\\\\]|\\\\.|\\$\\{(?:(?!\\})(?:<expr>))*\\})*\\1'.replace(
            /<expr>/g,
            function () {
              return i;
            }
          )
        ),
        greedy: !0,
        inside: {
          interpolation: {
            pattern: RegExp(
              '((?:^|[^\\\\])(?:\\\\\\\\)*)\\$\\{(?:(?!\\})(?:<expr>))*\\}'.replace(
                /<expr>/g,
                function () {
                  return i;
                }
              )
            ),
            lookbehind: !0,
            inside: {
              'interpolation-punctuation': {
                pattern: /^\$\{|\}$/,
                alias: 'punctuation',
              },
              rest: null,
            },
          },
        },
      },
    ],
    keyword: /\b(?:as)\b/,
    boolean: /\b(?:false|true)\b/,
    'builtin-function': {
      pattern: /((?:^|[^?])\?\s*)\w+/,
      lookbehind: !0,
      alias: 'function',
    },
    function: /\b\w+(?=\s*\()/,
    number: /\b\d+(?:\.\d+)?\b/,
    operator:
      /\.\.[<*!]?|->|--|\+\+|&&|\|\||\?{1,2}|[-+*/%!=<>]=?|\b(?:gt|gte|lt|lte)\b/,
    punctuation: /[,;.:()[\]{}]/,
  };
  (t.string[1].inside.interpolation.inside.rest = t),
    (n.languages.ftl = {
      'ftl-comment': { pattern: /^<#--[\s\S]*/, alias: 'comment' },
      'ftl-directive': {
        pattern: /^<[\s\S]+>$/,
        inside: {
          directive: {
            pattern: /(^<\/?)[#@][a-z]\w*/i,
            lookbehind: !0,
            alias: 'keyword',
          },
          punctuation: /^<\/?|\/?>$/,
          content: { pattern: /\s*\S[\s\S]*/, alias: 'ftl', inside: t },
        },
      },
      'ftl-interpolation': {
        pattern: /^\$\{[\s\S]*\}$/,
        inside: {
          punctuation: /^\$\{|\}$/,
          content: { pattern: /\s*\S[\s\S]*/, alias: 'ftl', inside: t },
        },
      },
    }),
    n.hooks.add('before-tokenize', function (e) {
      var t = RegExp(
        '<#--[^]*?--\x3e|</?[#@][a-zA-Z](?:<expr>)*?>|\\$\\{(?:<expr>)*?\\}'.replace(
          /<expr>/g,
          function () {
            return i;
          }
        ),
        'gi'
      );
      n.languages['markup-templating'].buildPlaceholders(e, 'ftl', t);
    }),
    n.hooks.add('after-tokenize', function (e) {
      n.languages['markup-templating'].tokenizePlaceholders(e, 'ftl');
    });
})(Prism);