更换版本
This commit is contained in:
566
towxml/plugins/hljs/highlight.js
Normal file
566
towxml/plugins/hljs/highlight.js
Normal file
@@ -0,0 +1,566 @@
|
||||
var e;
|
||||
(e =
|
||||
"function" == typeof Symbol && "symbol" == typeof Symbol.iterator
|
||||
? function (e) {
|
||||
return typeof e;
|
||||
}
|
||||
: function (e) {
|
||||
return e &&
|
||||
"function" == typeof Symbol &&
|
||||
e.constructor === Symbol &&
|
||||
e !== Symbol.prototype
|
||||
? "symbol"
|
||||
: typeof e;
|
||||
}),
|
||||
(function (n) {
|
||||
var t =
|
||||
("object" == ("undefined" == typeof window ? "undefined" : e(window)) &&
|
||||
window) ||
|
||||
("object" == ("undefined" == typeof self ? "undefined" : e(self)) &&
|
||||
self);
|
||||
"undefined" != typeof exports
|
||||
? n(exports)
|
||||
: t &&
|
||||
((t.hljs = n({})),
|
||||
"function" == typeof define &&
|
||||
define.amd &&
|
||||
define([], function () {
|
||||
return t.hljs;
|
||||
}));
|
||||
})(function (e) {
|
||||
function n(e) {
|
||||
return e
|
||||
.replace(/&/g, "&")
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">");
|
||||
}
|
||||
function t(e) {
|
||||
return e.nodeName.toLowerCase();
|
||||
}
|
||||
function r(e, n) {
|
||||
var t = e && e.exec(n);
|
||||
return t && 0 === t.index;
|
||||
}
|
||||
function a(e) {
|
||||
return _.test(e);
|
||||
}
|
||||
function i(e) {
|
||||
var n,
|
||||
t = {},
|
||||
r = Array.prototype.slice.call(arguments, 1);
|
||||
for (n in e) t[n] = e[n];
|
||||
return (
|
||||
r.forEach(function (e) {
|
||||
for (n in e) t[n] = e[n];
|
||||
}),
|
||||
t
|
||||
);
|
||||
}
|
||||
function o(e) {
|
||||
var n = [];
|
||||
return (
|
||||
(function e(r, a) {
|
||||
for (var i = r.firstChild; i; i = i.nextSibling)
|
||||
3 === i.nodeType
|
||||
? (a += i.nodeValue.length)
|
||||
: 1 === i.nodeType &&
|
||||
(n.push({ event: "start", offset: a, node: i }),
|
||||
(a = e(i, a)),
|
||||
t(i).match(/br|hr|img|input/) ||
|
||||
n.push({ event: "stop", offset: a, node: i }));
|
||||
return a;
|
||||
})(e, 0),
|
||||
n
|
||||
);
|
||||
}
|
||||
function s(e, r, a) {
|
||||
function i() {
|
||||
return e.length && r.length
|
||||
? e[0].offset !== r[0].offset
|
||||
? e[0].offset < r[0].offset
|
||||
? e
|
||||
: r
|
||||
: "start" === r[0].event
|
||||
? e
|
||||
: r
|
||||
: e.length
|
||||
? e
|
||||
: r;
|
||||
}
|
||||
function o(e) {
|
||||
c +=
|
||||
"<" +
|
||||
t(e) +
|
||||
v.map
|
||||
.call(e.attributes, function (e) {
|
||||
return (
|
||||
" " +
|
||||
e.nodeName +
|
||||
'="' +
|
||||
n(e.value).replace('"', """) +
|
||||
'"'
|
||||
);
|
||||
})
|
||||
.join("") +
|
||||
">";
|
||||
}
|
||||
function s(e) {
|
||||
c += "</" + t(e) + ">";
|
||||
}
|
||||
function l(e) {
|
||||
("start" === e.event ? o : s)(e.node);
|
||||
}
|
||||
for (var u = 0, c = "", g = []; e.length || r.length; ) {
|
||||
var f = i();
|
||||
if (
|
||||
((c += n(a.substring(u, f[0].offset))), (u = f[0].offset), f === e)
|
||||
) {
|
||||
g.reverse().forEach(s);
|
||||
do {
|
||||
l(f.splice(0, 1)[0]), (f = i());
|
||||
} while (f === e && f.length && f[0].offset === u);
|
||||
g.reverse().forEach(o);
|
||||
} else
|
||||
"start" === f[0].event ? g.push(f[0].node) : g.pop(),
|
||||
l(f.splice(0, 1)[0]);
|
||||
}
|
||||
return c + n(a.substr(u));
|
||||
}
|
||||
function l(e) {
|
||||
return (
|
||||
e.variants &&
|
||||
!e.cached_variants &&
|
||||
(e.cached_variants = e.variants.map(function (n) {
|
||||
return i(e, { variants: null }, n);
|
||||
})),
|
||||
e.cached_variants || (e.endsWithParent && [i(e)]) || [e]
|
||||
);
|
||||
}
|
||||
function u(e) {
|
||||
function n(e) {
|
||||
return (e && e.source) || e;
|
||||
}
|
||||
function t(t, r) {
|
||||
return new RegExp(
|
||||
n(t),
|
||||
"m" + (e.case_insensitive ? "i" : "") + (r ? "g" : "")
|
||||
);
|
||||
}
|
||||
!(function r(a, i) {
|
||||
if (!a.compiled) {
|
||||
if (
|
||||
((a.compiled = !0),
|
||||
(a.keywords = a.keywords || a.beginKeywords),
|
||||
a.keywords)
|
||||
) {
|
||||
var o = {},
|
||||
s = function (n, t) {
|
||||
e.case_insensitive && (t = t.toLowerCase()),
|
||||
t.split(" ").forEach(function (e) {
|
||||
var t = e.split("|");
|
||||
o[t[0]] = [n, t[1] ? Number(t[1]) : 1];
|
||||
});
|
||||
};
|
||||
"string" == typeof a.keywords
|
||||
? s("keyword", a.keywords)
|
||||
: m(a.keywords).forEach(function (e) {
|
||||
s(e, a.keywords[e]);
|
||||
}),
|
||||
(a.keywords = o);
|
||||
}
|
||||
(a.lexemesRe = t(a.lexemes || /\w+/, !0)),
|
||||
i &&
|
||||
(a.beginKeywords &&
|
||||
(a.begin =
|
||||
"\\b(" + a.beginKeywords.split(" ").join("|") + ")\\b"),
|
||||
a.begin || (a.begin = /\B|\b/),
|
||||
(a.beginRe = t(a.begin)),
|
||||
a.end || a.endsWithParent || (a.end = /\B|\b/),
|
||||
a.end && (a.endRe = t(a.end)),
|
||||
(a.terminator_end = n(a.end) || ""),
|
||||
a.endsWithParent &&
|
||||
i.terminator_end &&
|
||||
(a.terminator_end += (a.end ? "|" : "") + i.terminator_end)),
|
||||
a.illegal && (a.illegalRe = t(a.illegal)),
|
||||
null == a.relevance && (a.relevance = 1),
|
||||
a.contains || (a.contains = []),
|
||||
(a.contains = Array.prototype.concat.apply(
|
||||
[],
|
||||
a.contains.map(function (e) {
|
||||
return l("self" === e ? a : e);
|
||||
})
|
||||
)),
|
||||
a.contains.forEach(function (e) {
|
||||
r(e, a);
|
||||
}),
|
||||
a.starts && r(a.starts, i);
|
||||
var u = a.contains
|
||||
.map(function (e) {
|
||||
return e.beginKeywords ? "\\.?(" + e.begin + ")\\.?" : e.begin;
|
||||
})
|
||||
.concat([a.terminator_end, a.illegal])
|
||||
.map(n)
|
||||
.filter(Boolean);
|
||||
a.terminators = u.length
|
||||
? t(u.join("|"), !0)
|
||||
: {
|
||||
exec: function () {
|
||||
return null;
|
||||
},
|
||||
};
|
||||
}
|
||||
})(e);
|
||||
}
|
||||
function c(e, t, a, i) {
|
||||
function o(e, n) {
|
||||
var t, a;
|
||||
for (t = 0, a = n.contains.length; t < a; t++)
|
||||
if (r(n.contains[t].beginRe, e)) return n.contains[t];
|
||||
}
|
||||
function s(e, n) {
|
||||
if (r(e.endRe, n)) {
|
||||
for (; e.endsParent && e.parent; ) e = e.parent;
|
||||
return e;
|
||||
}
|
||||
if (e.endsWithParent) return s(e.parent, n);
|
||||
}
|
||||
function l(e, n) {
|
||||
return !a && r(n.illegalRe, e);
|
||||
}
|
||||
function f(e, n) {
|
||||
var t = h.case_insensitive ? n[0].toLowerCase() : n[0];
|
||||
return e.keywords.hasOwnProperty(t) && e.keywords[t];
|
||||
}
|
||||
function d(e, n, t, r) {
|
||||
var a = '<span class="' + (r ? "" : y.classPrefix);
|
||||
return (a += e + '">') + n + (t ? "" : w);
|
||||
}
|
||||
function E() {
|
||||
(M +=
|
||||
null != R.subLanguage
|
||||
? (function () {
|
||||
var e = "string" == typeof R.subLanguage;
|
||||
if (e && !b[R.subLanguage]) return n(x);
|
||||
var t = e
|
||||
? c(R.subLanguage, x, !0, N[R.subLanguage])
|
||||
: g(x, R.subLanguage.length ? R.subLanguage : void 0);
|
||||
return (
|
||||
R.relevance > 0 && (O += t.relevance),
|
||||
e && (N[R.subLanguage] = t.top),
|
||||
d(t.language, t.value, !1, !0)
|
||||
);
|
||||
})()
|
||||
: (function () {
|
||||
var e, t, r, a;
|
||||
if (!R.keywords) return n(x);
|
||||
for (
|
||||
a = "",
|
||||
t = 0,
|
||||
R.lexemesRe.lastIndex = 0,
|
||||
r = R.lexemesRe.exec(x);
|
||||
r;
|
||||
|
||||
)
|
||||
(a += n(x.substring(t, r.index))),
|
||||
(e = f(R, r))
|
||||
? ((O += e[1]), (a += d(e[0], n(r[0]))))
|
||||
: (a += n(r[0])),
|
||||
(t = R.lexemesRe.lastIndex),
|
||||
(r = R.lexemesRe.exec(x));
|
||||
return a + n(x.substr(t));
|
||||
})()),
|
||||
(x = "");
|
||||
}
|
||||
function v(e) {
|
||||
(M += e.className ? d(e.className, "", !0) : ""),
|
||||
(R = Object.create(e, { parent: { value: R } }));
|
||||
}
|
||||
function m(e, n) {
|
||||
if (((x += e), null == n)) return E(), 0;
|
||||
var t = o(n, R);
|
||||
if (t)
|
||||
return (
|
||||
t.skip
|
||||
? (x += n)
|
||||
: (t.excludeBegin && (x += n),
|
||||
E(),
|
||||
t.returnBegin || t.excludeBegin || (x = n)),
|
||||
v(t),
|
||||
t.returnBegin ? 0 : n.length
|
||||
);
|
||||
var r = s(R, n);
|
||||
if (r) {
|
||||
var a = R;
|
||||
a.skip
|
||||
? (x += n)
|
||||
: (a.returnEnd || a.excludeEnd || (x += n),
|
||||
E(),
|
||||
a.excludeEnd && (x = n));
|
||||
do {
|
||||
R.className && (M += w),
|
||||
R.skip || (O += R.relevance),
|
||||
(R = R.parent);
|
||||
} while (R !== r.parent);
|
||||
return r.starts && v(r.starts), a.returnEnd ? 0 : n.length;
|
||||
}
|
||||
if (l(n, R))
|
||||
throw new Error(
|
||||
'Illegal lexeme "' +
|
||||
n +
|
||||
'" for mode "' +
|
||||
(R.className || "<unnamed>") +
|
||||
'"'
|
||||
);
|
||||
return (x += n), n.length || 1;
|
||||
}
|
||||
var h = p(e);
|
||||
if (!h) throw new Error('Unknown language: "' + e + '"');
|
||||
u(h);
|
||||
var _,
|
||||
R = i || h,
|
||||
N = {},
|
||||
M = "";
|
||||
for (_ = R; _ !== h; _ = _.parent)
|
||||
_.className && (M = d(_.className, "", !0) + M);
|
||||
var x = "",
|
||||
O = 0;
|
||||
try {
|
||||
for (
|
||||
var S, C, L = 0;
|
||||
(R.terminators.lastIndex = L), (S = R.terminators.exec(t));
|
||||
|
||||
)
|
||||
(C = m(t.substring(L, S.index), S[0])), (L = S.index + C);
|
||||
for (m(t.substr(L)), _ = R; _.parent; _ = _.parent)
|
||||
_.className && (M += w);
|
||||
return { relevance: O, value: M, language: e, top: R };
|
||||
} catch (e) {
|
||||
if (e.message && -1 !== e.message.indexOf("Illegal"))
|
||||
return { relevance: 0, value: n(t) };
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
function g(e, t) {
|
||||
t = t || y.languages || m(b);
|
||||
var r = { relevance: 0, value: n(e) },
|
||||
a = r;
|
||||
return (
|
||||
t.filter(p).forEach(function (n) {
|
||||
var t = c(n, e, !1);
|
||||
(t.language = n),
|
||||
t.relevance > a.relevance && (a = t),
|
||||
t.relevance > r.relevance && ((a = r), (r = t));
|
||||
}),
|
||||
a.language && (r.second_best = a),
|
||||
r
|
||||
);
|
||||
}
|
||||
function f(e) {
|
||||
return y.tabReplace || y.useBR
|
||||
? e.replace(N, function (e, n) {
|
||||
return y.useBR && "\n" === e
|
||||
? "<br>"
|
||||
: y.tabReplace
|
||||
? n.replace(/\t/g, y.tabReplace)
|
||||
: "";
|
||||
})
|
||||
: e;
|
||||
}
|
||||
function d(e) {
|
||||
var n,
|
||||
t,
|
||||
r,
|
||||
i,
|
||||
l,
|
||||
u = (function (e) {
|
||||
var n,
|
||||
t,
|
||||
r,
|
||||
i,
|
||||
o = e.className + " ";
|
||||
if (
|
||||
((o += e.parentNode ? e.parentNode.className : ""), (t = R.exec(o)))
|
||||
)
|
||||
return p(t[1]) ? t[1] : "no-highlight";
|
||||
for (n = 0, r = (o = o.split(/\s+/)).length; n < r; n++)
|
||||
if (a((i = o[n])) || p(i)) return i;
|
||||
})(e);
|
||||
a(u) ||
|
||||
(y.useBR
|
||||
? ((n = document.createElementNS(
|
||||
"http://www.w3.org/1999/xhtml",
|
||||
"div"
|
||||
)).innerHTML = e.innerHTML
|
||||
.replace(/\n/g, "")
|
||||
.replace(/<br[ \/]*>/g, "\n"))
|
||||
: (n = e),
|
||||
(l = n.textContent),
|
||||
(r = u ? c(u, l, !0) : g(l)),
|
||||
(t = o(n)).length &&
|
||||
(((i = document.createElementNS(
|
||||
"http://www.w3.org/1999/xhtml",
|
||||
"div"
|
||||
)).innerHTML = r.value),
|
||||
(r.value = s(t, o(i), l))),
|
||||
(r.value = f(r.value)),
|
||||
(e.innerHTML = r.value),
|
||||
(e.className = (function (e, n, t) {
|
||||
var r = n ? h[n] : t,
|
||||
a = [e.trim()];
|
||||
return (
|
||||
e.match(/\bhljs\b/) || a.push("hljs"),
|
||||
-1 === e.indexOf(r) && a.push(r),
|
||||
a.join(" ").trim()
|
||||
);
|
||||
})(e.className, u, r.language)),
|
||||
(e.result = { language: r.language, re: r.relevance }),
|
||||
r.second_best &&
|
||||
(e.second_best = {
|
||||
language: r.second_best.language,
|
||||
re: r.second_best.relevance,
|
||||
}));
|
||||
}
|
||||
function E() {
|
||||
if (!E.called) {
|
||||
E.called = !0;
|
||||
var e = document.querySelectorAll("pre code");
|
||||
v.forEach.call(e, d);
|
||||
}
|
||||
}
|
||||
function p(e) {
|
||||
return (e = (e || "").toLowerCase()), b[e] || b[h[e]];
|
||||
}
|
||||
var v = [],
|
||||
m = Object.keys,
|
||||
b = {},
|
||||
h = {},
|
||||
_ = /^(no-?highlight|plain|text)$/i,
|
||||
R = /\blang(?:uage)?-([\w-]+)\b/i,
|
||||
N = /((^(<[^>]+>|\t|)+|(?:\n)))/gm,
|
||||
w = "</span>",
|
||||
y = {
|
||||
classPrefix: "hljs-",
|
||||
tabReplace: null,
|
||||
useBR: !1,
|
||||
languages: void 0,
|
||||
};
|
||||
return (
|
||||
(e.highlight = c),
|
||||
(e.highlightAuto = g),
|
||||
(e.fixMarkup = f),
|
||||
(e.highlightBlock = d),
|
||||
(e.configure = function (e) {
|
||||
y = i(y, e);
|
||||
}),
|
||||
(e.initHighlighting = E),
|
||||
(e.initHighlightingOnLoad = function () {
|
||||
addEventListener("DOMContentLoaded", E, !1),
|
||||
addEventListener("load", E, !1);
|
||||
}),
|
||||
(e.registerLanguage = function (n, t) {
|
||||
var r = (b[n] = t(e));
|
||||
r.aliases &&
|
||||
r.aliases.forEach(function (e) {
|
||||
h[e] = n;
|
||||
});
|
||||
}),
|
||||
(e.listLanguages = function () {
|
||||
return m(b);
|
||||
}),
|
||||
(e.getLanguage = p),
|
||||
(e.inherit = i),
|
||||
(e.IDENT_RE = "[a-zA-Z]\\w*"),
|
||||
(e.UNDERSCORE_IDENT_RE = "[a-zA-Z_]\\w*"),
|
||||
(e.NUMBER_RE = "\\b\\d+(\\.\\d+)?"),
|
||||
(e.C_NUMBER_RE =
|
||||
"(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)"),
|
||||
(e.BINARY_NUMBER_RE = "\\b(0b[01]+)"),
|
||||
(e.RE_STARTERS_RE =
|
||||
"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~"),
|
||||
(e.BACKSLASH_ESCAPE = { begin: "\\\\[\\s\\S]", relevance: 0 }),
|
||||
(e.APOS_STRING_MODE = {
|
||||
className: "string",
|
||||
begin: "'",
|
||||
end: "'",
|
||||
illegal: "\\n",
|
||||
contains: [e.BACKSLASH_ESCAPE],
|
||||
}),
|
||||
(e.QUOTE_STRING_MODE = {
|
||||
className: "string",
|
||||
begin: '"',
|
||||
end: '"',
|
||||
illegal: "\\n",
|
||||
contains: [e.BACKSLASH_ESCAPE],
|
||||
}),
|
||||
(e.PHRASAL_WORDS_MODE = {
|
||||
begin:
|
||||
/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/,
|
||||
}),
|
||||
(e.COMMENT = function (n, t, r) {
|
||||
var a = e.inherit(
|
||||
{ className: "comment", begin: n, end: t, contains: [] },
|
||||
r || {}
|
||||
);
|
||||
return (
|
||||
a.contains.push(e.PHRASAL_WORDS_MODE),
|
||||
a.contains.push({
|
||||
className: "doctag",
|
||||
begin: "(?:TODO|FIXME|NOTE|BUG|XXX):",
|
||||
relevance: 0,
|
||||
}),
|
||||
a
|
||||
);
|
||||
}),
|
||||
(e.C_LINE_COMMENT_MODE = e.COMMENT("//", "$")),
|
||||
(e.C_BLOCK_COMMENT_MODE = e.COMMENT("/\\*", "\\*/")),
|
||||
(e.HASH_COMMENT_MODE = e.COMMENT("#", "$")),
|
||||
(e.NUMBER_MODE = {
|
||||
className: "number",
|
||||
begin: e.NUMBER_RE,
|
||||
relevance: 0,
|
||||
}),
|
||||
(e.C_NUMBER_MODE = {
|
||||
className: "number",
|
||||
begin: e.C_NUMBER_RE,
|
||||
relevance: 0,
|
||||
}),
|
||||
(e.BINARY_NUMBER_MODE = {
|
||||
className: "number",
|
||||
begin: e.BINARY_NUMBER_RE,
|
||||
relevance: 0,
|
||||
}),
|
||||
(e.CSS_NUMBER_MODE = {
|
||||
className: "number",
|
||||
begin:
|
||||
e.NUMBER_RE +
|
||||
"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",
|
||||
relevance: 0,
|
||||
}),
|
||||
(e.REGEXP_MODE = {
|
||||
className: "regexp",
|
||||
begin: /\//,
|
||||
end: /\/[gimuy]*/,
|
||||
illegal: /\n/,
|
||||
contains: [
|
||||
e.BACKSLASH_ESCAPE,
|
||||
{
|
||||
begin: /\[/,
|
||||
end: /\]/,
|
||||
relevance: 0,
|
||||
contains: [e.BACKSLASH_ESCAPE],
|
||||
},
|
||||
],
|
||||
}),
|
||||
(e.TITLE_MODE = { className: "title", begin: e.IDENT_RE, relevance: 0 }),
|
||||
(e.UNDERSCORE_TITLE_MODE = {
|
||||
className: "title",
|
||||
begin: e.UNDERSCORE_IDENT_RE,
|
||||
relevance: 0,
|
||||
}),
|
||||
(e.METHOD_GUARD = {
|
||||
begin: "\\.\\s*" + e.UNDERSCORE_IDENT_RE,
|
||||
relevance: 0,
|
||||
}),
|
||||
e
|
||||
);
|
||||
});
|
||||
21
towxml/plugins/hljs/index.js
Normal file
21
towxml/plugins/hljs/index.js
Normal file
@@ -0,0 +1,21 @@
|
||||
var e;
|
||||
(e = require("./highlight")).registerLanguage(
|
||||
"bash",
|
||||
require("./languages/bash")
|
||||
),
|
||||
e.registerLanguage("coffeescript", require("./languages/coffeescript")),
|
||||
e.registerLanguage("css", require("./languages/css")),
|
||||
e.registerLanguage("dns", require("./languages/dns")),
|
||||
e.registerLanguage("dos", require("./languages/dos")),
|
||||
e.registerLanguage("erlang", require("./languages/erlang")),
|
||||
e.registerLanguage("htmlbars", require("./languages/htmlbars")),
|
||||
e.registerLanguage("http", require("./languages/http")),
|
||||
e.registerLanguage("javascript", require("./languages/javascript")),
|
||||
e.registerLanguage("json", require("./languages/json")),
|
||||
e.registerLanguage("less", require("./languages/less")),
|
||||
e.registerLanguage("makefile", require("./languages/makefile")),
|
||||
e.registerLanguage("nginx", require("./languages/nginx")),
|
||||
e.registerLanguage("scss", require("./languages/scss")),
|
||||
e.registerLanguage("sql", require("./languages/sql")),
|
||||
e.registerLanguage("typescript", require("./languages/typescript")),
|
||||
(module.exports = e);
|
||||
46
towxml/plugins/hljs/languages/bash.js
Normal file
46
towxml/plugins/hljs/languages/bash.js
Normal file
@@ -0,0 +1,46 @@
|
||||
module.exports = function (e) {
|
||||
var t = {
|
||||
className: "variable",
|
||||
variants: [{ begin: /\$[\w\d#@][\w\d_]*/ }, { begin: /\$\{(.*?)}/ }],
|
||||
},
|
||||
s = {
|
||||
className: "string",
|
||||
begin: /"/,
|
||||
end: /"/,
|
||||
contains: [
|
||||
e.BACKSLASH_ESCAPE,
|
||||
t,
|
||||
{
|
||||
className: "variable",
|
||||
begin: /\$\(/,
|
||||
end: /\)/,
|
||||
contains: [e.BACKSLASH_ESCAPE],
|
||||
},
|
||||
],
|
||||
};
|
||||
return {
|
||||
aliases: ["sh", "zsh"],
|
||||
lexemes: /\b-?[a-z\._]+\b/,
|
||||
keywords: {
|
||||
keyword: "if then else elif fi for while in do done case esac function",
|
||||
literal: "true false",
|
||||
built_in:
|
||||
"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp",
|
||||
_: "-ne -eq -lt -gt -f -d -e -s -l -a",
|
||||
},
|
||||
contains: [
|
||||
{ className: "meta", begin: /^#![^\n]+sh\s*$/, relevance: 10 },
|
||||
{
|
||||
className: "function",
|
||||
begin: /\w[\w\d_]*\s*\(\s*\)\s*\{/,
|
||||
returnBegin: !0,
|
||||
contains: [e.inherit(e.TITLE_MODE, { begin: /\w[\w\d_]*/ })],
|
||||
relevance: 0,
|
||||
},
|
||||
e.HASH_COMMENT_MODE,
|
||||
s,
|
||||
{ className: "string", begin: /'/, end: /'/ },
|
||||
t,
|
||||
],
|
||||
};
|
||||
};
|
||||
103
towxml/plugins/hljs/languages/coffeescript.js
Normal file
103
towxml/plugins/hljs/languages/coffeescript.js
Normal file
@@ -0,0 +1,103 @@
|
||||
module.exports = function (e) {
|
||||
var n = {
|
||||
keyword:
|
||||
"in if for while finally new do return else break catch instanceof throw try this switch continue typeof delete debugger super yield import export from as default await then unless until loop of by when and or is isnt not",
|
||||
literal: "true false null undefined yes no on off",
|
||||
built_in: "npm require console print module global window document",
|
||||
},
|
||||
i = "[A-Za-z$_][0-9A-Za-z$_]*",
|
||||
s = { className: "subst", begin: /#\{/, end: /}/, keywords: n },
|
||||
a = [
|
||||
e.BINARY_NUMBER_MODE,
|
||||
e.inherit(e.C_NUMBER_MODE, { starts: { end: "(\\s*/)?", relevance: 0 } }),
|
||||
{
|
||||
className: "string",
|
||||
variants: [
|
||||
{ begin: /'''/, end: /'''/, contains: [e.BACKSLASH_ESCAPE] },
|
||||
{ begin: /'/, end: /'/, contains: [e.BACKSLASH_ESCAPE] },
|
||||
{ begin: /"""/, end: /"""/, contains: [e.BACKSLASH_ESCAPE, s] },
|
||||
{ begin: /"/, end: /"/, contains: [e.BACKSLASH_ESCAPE, s] },
|
||||
],
|
||||
},
|
||||
{
|
||||
className: "regexp",
|
||||
variants: [
|
||||
{ begin: "///", end: "///", contains: [s, e.HASH_COMMENT_MODE] },
|
||||
{ begin: "//[gim]*", relevance: 0 },
|
||||
{ begin: /\/(?![ *])(\\\/|.)*?\/[gim]*(?=\W|$)/ },
|
||||
],
|
||||
},
|
||||
{ begin: "@" + i },
|
||||
{
|
||||
subLanguage: "javascript",
|
||||
excludeBegin: !0,
|
||||
excludeEnd: !0,
|
||||
variants: [
|
||||
{ begin: "```", end: "```" },
|
||||
{ begin: "`", end: "`" },
|
||||
],
|
||||
},
|
||||
];
|
||||
s.contains = a;
|
||||
var t = e.inherit(e.TITLE_MODE, { begin: i }),
|
||||
r = "(\\(.*\\))?\\s*\\B[-=]>",
|
||||
o = {
|
||||
className: "params",
|
||||
begin: "\\([^\\(]",
|
||||
returnBegin: !0,
|
||||
contains: [
|
||||
{ begin: /\(/, end: /\)/, keywords: n, contains: ["self"].concat(a) },
|
||||
],
|
||||
};
|
||||
return {
|
||||
aliases: ["coffee", "cson", "iced"],
|
||||
keywords: n,
|
||||
illegal: /\/\*/,
|
||||
contains: a.concat([
|
||||
e.COMMENT("###", "###"),
|
||||
e.HASH_COMMENT_MODE,
|
||||
{
|
||||
className: "function",
|
||||
begin: "^\\s*" + i + "\\s*=\\s*" + r,
|
||||
end: "[-=]>",
|
||||
returnBegin: !0,
|
||||
contains: [t, o],
|
||||
},
|
||||
{
|
||||
begin: /[:\(,=]\s*/,
|
||||
relevance: 0,
|
||||
contains: [
|
||||
{
|
||||
className: "function",
|
||||
begin: r,
|
||||
end: "[-=]>",
|
||||
returnBegin: !0,
|
||||
contains: [o],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
className: "class",
|
||||
beginKeywords: "class",
|
||||
end: "$",
|
||||
illegal: /[:="\[\]]/,
|
||||
contains: [
|
||||
{
|
||||
beginKeywords: "extends",
|
||||
endsWithParent: !0,
|
||||
illegal: /[:="\[\]]/,
|
||||
contains: [t],
|
||||
},
|
||||
t,
|
||||
],
|
||||
},
|
||||
{
|
||||
begin: i + ":",
|
||||
end: ":",
|
||||
returnBegin: !0,
|
||||
returnEnd: !0,
|
||||
relevance: 0,
|
||||
},
|
||||
]),
|
||||
};
|
||||
};
|
||||
86
towxml/plugins/hljs/languages/css.js
Normal file
86
towxml/plugins/hljs/languages/css.js
Normal file
@@ -0,0 +1,86 @@
|
||||
module.exports = function (e) {
|
||||
var n = {
|
||||
begin: /[A-Z\_\.\-]+\s*:/,
|
||||
returnBegin: !0,
|
||||
end: ";",
|
||||
endsWithParent: !0,
|
||||
contains: [
|
||||
{
|
||||
className: "attribute",
|
||||
begin: /\S/,
|
||||
end: ":",
|
||||
excludeEnd: !0,
|
||||
starts: {
|
||||
endsWithParent: !0,
|
||||
excludeEnd: !0,
|
||||
contains: [
|
||||
{
|
||||
begin: /[\w-]+\(/,
|
||||
returnBegin: !0,
|
||||
contains: [
|
||||
{ className: "built_in", begin: /[\w-]+/ },
|
||||
{
|
||||
begin: /\(/,
|
||||
end: /\)/,
|
||||
contains: [e.APOS_STRING_MODE, e.QUOTE_STRING_MODE],
|
||||
},
|
||||
],
|
||||
},
|
||||
e.CSS_NUMBER_MODE,
|
||||
e.QUOTE_STRING_MODE,
|
||||
e.APOS_STRING_MODE,
|
||||
e.C_BLOCK_COMMENT_MODE,
|
||||
{ className: "number", begin: "#[0-9A-Fa-f]+" },
|
||||
{ className: "meta", begin: "!important" },
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
return {
|
||||
case_insensitive: !0,
|
||||
illegal: /[=\/|'\$]/,
|
||||
contains: [
|
||||
e.C_BLOCK_COMMENT_MODE,
|
||||
{ className: "selector-id", begin: /#[A-Za-z0-9_-]+/ },
|
||||
{ className: "selector-class", begin: /\.[A-Za-z0-9_-]+/ },
|
||||
{ className: "selector-attr", begin: /\[/, end: /\]/, illegal: "$" },
|
||||
{ className: "selector-pseudo", begin: /:(:)?[a-zA-Z0-9\_\-\+\(\)"'.]+/ },
|
||||
{
|
||||
begin: "@(font-face|page)",
|
||||
lexemes: "[a-z-]+",
|
||||
keywords: "font-face page",
|
||||
},
|
||||
{
|
||||
begin: "@",
|
||||
end: "[{;]",
|
||||
illegal: /:/,
|
||||
contains: [
|
||||
{ className: "keyword", begin: /\w+/ },
|
||||
{
|
||||
begin: /\s/,
|
||||
endsWithParent: !0,
|
||||
excludeEnd: !0,
|
||||
relevance: 0,
|
||||
contains: [
|
||||
e.APOS_STRING_MODE,
|
||||
e.QUOTE_STRING_MODE,
|
||||
e.CSS_NUMBER_MODE,
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
className: "selector-tag",
|
||||
begin: "[a-zA-Z-][a-zA-Z0-9_-]*",
|
||||
relevance: 0,
|
||||
},
|
||||
{
|
||||
begin: "{",
|
||||
end: "}",
|
||||
illegal: /\S/,
|
||||
contains: [e.C_BLOCK_COMMENT_MODE, n],
|
||||
},
|
||||
],
|
||||
};
|
||||
};
|
||||
24
towxml/plugins/hljs/languages/dns.js
Normal file
24
towxml/plugins/hljs/languages/dns.js
Normal file
@@ -0,0 +1,24 @@
|
||||
module.exports = function (d) {
|
||||
return {
|
||||
aliases: ["bind", "zone"],
|
||||
keywords: {
|
||||
keyword:
|
||||
"IN A AAAA AFSDB APL CAA CDNSKEY CDS CERT CNAME DHCID DLV DNAME DNSKEY DS HIP IPSECKEY KEY KX LOC MX NAPTR NS NSEC NSEC3 NSEC3PARAM PTR RRSIG RP SIG SOA SRV SSHFP TA TKEY TLSA TSIG TXT",
|
||||
},
|
||||
contains: [
|
||||
d.COMMENT(";", "$", { relevance: 0 }),
|
||||
{ className: "meta", begin: /^\$(TTL|GENERATE|INCLUDE|ORIGIN)\b/ },
|
||||
{
|
||||
className: "number",
|
||||
begin:
|
||||
"((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))\\b",
|
||||
},
|
||||
{
|
||||
className: "number",
|
||||
begin:
|
||||
"((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\b",
|
||||
},
|
||||
d.inherit(d.NUMBER_MODE, { begin: /\b\d+[dhwm]?/ }),
|
||||
],
|
||||
};
|
||||
};
|
||||
30
towxml/plugins/hljs/languages/dos.js
Normal file
30
towxml/plugins/hljs/languages/dos.js
Normal file
@@ -0,0 +1,30 @@
|
||||
module.exports = function (e) {
|
||||
var r = e.COMMENT(/^\s*@?rem\b/, /$/, { relevance: 10 });
|
||||
return {
|
||||
aliases: ["bat", "cmd"],
|
||||
case_insensitive: !0,
|
||||
illegal: /\/\*/,
|
||||
keywords: {
|
||||
keyword:
|
||||
"if else goto for in do call exit not exist errorlevel defined equ neq lss leq gtr geq",
|
||||
built_in:
|
||||
"prn nul lpt3 lpt2 lpt1 con com4 com3 com2 com1 aux shift cd dir echo setlocal endlocal set pause copy append assoc at attrib break cacls cd chcp chdir chkdsk chkntfs cls cmd color comp compact convert date dir diskcomp diskcopy doskey erase fs find findstr format ftype graftabl help keyb label md mkdir mode more move path pause print popd pushd promt rd recover rem rename replace restore rmdir shiftsort start subst time title tree type ver verify vol ping net ipconfig taskkill xcopy ren del",
|
||||
},
|
||||
contains: [
|
||||
{ className: "variable", begin: /%%[^ ]|%[^ ]+?%|![^ ]+?!/ },
|
||||
{
|
||||
className: "function",
|
||||
begin: "^\\s*[A-Za-z._?][A-Za-z0-9_$#@~.?]*(:|\\s+label)",
|
||||
end: "goto:eof",
|
||||
contains: [
|
||||
e.inherit(e.TITLE_MODE, {
|
||||
begin: "([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*",
|
||||
}),
|
||||
r,
|
||||
],
|
||||
},
|
||||
{ className: "number", begin: "\\b\\d+", relevance: 0 },
|
||||
r,
|
||||
],
|
||||
};
|
||||
};
|
||||
96
towxml/plugins/hljs/languages/erlang.js
Normal file
96
towxml/plugins/hljs/languages/erlang.js
Normal file
@@ -0,0 +1,96 @@
|
||||
module.exports = function (e) {
|
||||
var n = "[a-z'][a-zA-Z0-9_']*",
|
||||
i = "(" + n + ":" + n + "|" + n + ")",
|
||||
r = {
|
||||
keyword:
|
||||
"after and andalso|10 band begin bnot bor bsl bzr bxor case catch cond div end fun if let not of orelse|10 query receive rem try when xor",
|
||||
literal: "false true",
|
||||
},
|
||||
a = e.COMMENT("%", "$"),
|
||||
c = {
|
||||
className: "number",
|
||||
begin: "\\b(\\d+#[a-fA-F0-9]+|\\d+(\\.\\d+)?([eE][-+]?\\d+)?)",
|
||||
relevance: 0,
|
||||
},
|
||||
s = { begin: "fun\\s+" + n + "/\\d+" },
|
||||
d = {
|
||||
begin: i + "\\(",
|
||||
end: "\\)",
|
||||
returnBegin: !0,
|
||||
relevance: 0,
|
||||
contains: [
|
||||
{ begin: i, relevance: 0 },
|
||||
{
|
||||
begin: "\\(",
|
||||
end: "\\)",
|
||||
endsWithParent: !0,
|
||||
returnEnd: !0,
|
||||
relevance: 0,
|
||||
},
|
||||
],
|
||||
},
|
||||
o = { begin: "{", end: "}", relevance: 0 },
|
||||
t = { begin: "\\b_([A-Z][A-Za-z0-9_]*)?", relevance: 0 },
|
||||
l = { begin: "[A-Z][a-zA-Z0-9_]*", relevance: 0 },
|
||||
b = {
|
||||
begin: "#" + e.UNDERSCORE_IDENT_RE,
|
||||
relevance: 0,
|
||||
returnBegin: !0,
|
||||
contains: [
|
||||
{ begin: "#" + e.UNDERSCORE_IDENT_RE, relevance: 0 },
|
||||
{ begin: "{", end: "}", relevance: 0 },
|
||||
],
|
||||
},
|
||||
g = { beginKeywords: "fun receive if try case", end: "end", keywords: r };
|
||||
g.contains = [
|
||||
a,
|
||||
s,
|
||||
e.inherit(e.APOS_STRING_MODE, { className: "" }),
|
||||
g,
|
||||
d,
|
||||
e.QUOTE_STRING_MODE,
|
||||
c,
|
||||
o,
|
||||
t,
|
||||
l,
|
||||
b,
|
||||
];
|
||||
var E = [a, s, g, d, e.QUOTE_STRING_MODE, c, o, t, l, b];
|
||||
(d.contains[1].contains = E), (o.contains = E), (b.contains[1].contains = E);
|
||||
var u = { className: "params", begin: "\\(", end: "\\)", contains: E };
|
||||
return {
|
||||
aliases: ["erl"],
|
||||
keywords: r,
|
||||
illegal: "(</|\\*=|\\+=|-=|/\\*|\\*/|\\(\\*|\\*\\))",
|
||||
contains: [
|
||||
{
|
||||
className: "function",
|
||||
begin: "^" + n + "\\s*\\(",
|
||||
end: "->",
|
||||
returnBegin: !0,
|
||||
illegal: "\\(|#|//|/\\*|\\\\|:|;",
|
||||
contains: [u, e.inherit(e.TITLE_MODE, { begin: n })],
|
||||
starts: { end: ";|\\.", keywords: r, contains: E },
|
||||
},
|
||||
a,
|
||||
{
|
||||
begin: "^-",
|
||||
end: "\\.",
|
||||
relevance: 0,
|
||||
excludeEnd: !0,
|
||||
returnBegin: !0,
|
||||
lexemes: "-" + e.IDENT_RE,
|
||||
keywords:
|
||||
"-module -record -undef -export -ifdef -ifndef -author -copyright -doc -vsn -import -include -include_lib -compile -define -else -endif -file -behaviour -behavior -spec",
|
||||
contains: [u],
|
||||
},
|
||||
c,
|
||||
e.QUOTE_STRING_MODE,
|
||||
b,
|
||||
t,
|
||||
l,
|
||||
o,
|
||||
{ begin: /\.$/ },
|
||||
],
|
||||
};
|
||||
};
|
||||
49
towxml/plugins/hljs/languages/htmlbars.js
Normal file
49
towxml/plugins/hljs/languages/htmlbars.js
Normal file
@@ -0,0 +1,49 @@
|
||||
module.exports = function (e) {
|
||||
var a =
|
||||
"action collection component concat debugger each each-in else get hash if input link-to loc log mut outlet partial query-params render textarea unbound unless with yield view",
|
||||
n =
|
||||
(e.QUOTE_STRING_MODE,
|
||||
{
|
||||
endsWithParent: !0,
|
||||
relevance: 0,
|
||||
keywords: { keyword: "as", built_in: a },
|
||||
contains: [
|
||||
e.QUOTE_STRING_MODE,
|
||||
{
|
||||
illegal: /\}\}/,
|
||||
begin: /[a-zA-Z0-9_]+=/,
|
||||
returnBegin: !0,
|
||||
relevance: 0,
|
||||
contains: [{ className: "attr", begin: /[a-zA-Z0-9_]+/ }],
|
||||
},
|
||||
e.NUMBER_MODE,
|
||||
],
|
||||
});
|
||||
return {
|
||||
case_insensitive: !0,
|
||||
subLanguage: "xml",
|
||||
contains: [
|
||||
e.COMMENT("{{!(--)?", "(--)?}}"),
|
||||
{
|
||||
className: "template-tag",
|
||||
begin: /\{\{[#\/]/,
|
||||
end: /\}\}/,
|
||||
contains: [
|
||||
{
|
||||
className: "name",
|
||||
begin: /[a-zA-Z\.\-]+/,
|
||||
keywords: { "builtin-name": a },
|
||||
starts: n,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
className: "template-variable",
|
||||
begin: /\{\{[a-zA-Z][a-zA-Z\-]+/,
|
||||
end: /\}\}/,
|
||||
keywords: { keyword: "as", built_in: a },
|
||||
contains: [e.QUOTE_STRING_MODE],
|
||||
},
|
||||
],
|
||||
};
|
||||
};
|
||||
39
towxml/plugins/hljs/languages/http.js
Normal file
39
towxml/plugins/hljs/languages/http.js
Normal file
@@ -0,0 +1,39 @@
|
||||
module.exports = function (e) {
|
||||
var n = "HTTP/[0-9\\.]+";
|
||||
return {
|
||||
aliases: ["https"],
|
||||
illegal: "\\S",
|
||||
contains: [
|
||||
{
|
||||
begin: "^" + n,
|
||||
end: "$",
|
||||
contains: [{ className: "number", begin: "\\b\\d{3}\\b" }],
|
||||
},
|
||||
{
|
||||
begin: "^[A-Z]+ (.*?) " + n + "$",
|
||||
returnBegin: !0,
|
||||
end: "$",
|
||||
contains: [
|
||||
{
|
||||
className: "string",
|
||||
begin: " ",
|
||||
end: " ",
|
||||
excludeBegin: !0,
|
||||
excludeEnd: !0,
|
||||
},
|
||||
{ begin: n },
|
||||
{ className: "keyword", begin: "[A-Z]+" },
|
||||
],
|
||||
},
|
||||
{
|
||||
className: "attribute",
|
||||
begin: "^\\w",
|
||||
end: ": ",
|
||||
excludeEnd: !0,
|
||||
illegal: "\\n|\\s|=",
|
||||
starts: { end: "$", relevance: 0 },
|
||||
},
|
||||
{ begin: "\\n\\n", starts: { subLanguage: [], endsWithParent: !0 } },
|
||||
],
|
||||
};
|
||||
};
|
||||
141
towxml/plugins/hljs/languages/javascript.js
Normal file
141
towxml/plugins/hljs/languages/javascript.js
Normal file
@@ -0,0 +1,141 @@
|
||||
module.exports = function (e) {
|
||||
var n = "[A-Za-z$_][0-9A-Za-z$_]*",
|
||||
a = {
|
||||
keyword:
|
||||
"in of if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const export super debugger as async await static import from as",
|
||||
literal: "true false null undefined NaN Infinity",
|
||||
built_in:
|
||||
"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect Promise",
|
||||
},
|
||||
r = {
|
||||
className: "number",
|
||||
variants: [
|
||||
{ begin: "\\b(0[bB][01]+)" },
|
||||
{ begin: "\\b(0[oO][0-7]+)" },
|
||||
{ begin: e.C_NUMBER_RE },
|
||||
],
|
||||
relevance: 0,
|
||||
},
|
||||
s = {
|
||||
className: "subst",
|
||||
begin: "\\$\\{",
|
||||
end: "\\}",
|
||||
keywords: a,
|
||||
contains: [],
|
||||
},
|
||||
i = {
|
||||
className: "string",
|
||||
begin: "`",
|
||||
end: "`",
|
||||
contains: [e.BACKSLASH_ESCAPE, s],
|
||||
};
|
||||
s.contains = [e.APOS_STRING_MODE, e.QUOTE_STRING_MODE, i, r, e.REGEXP_MODE];
|
||||
var t = s.contains.concat([e.C_BLOCK_COMMENT_MODE, e.C_LINE_COMMENT_MODE]);
|
||||
return {
|
||||
aliases: ["js", "jsx"],
|
||||
keywords: a,
|
||||
contains: [
|
||||
{
|
||||
className: "meta",
|
||||
relevance: 10,
|
||||
begin: /^\s*['"]use (strict|asm)['"]/,
|
||||
},
|
||||
{ className: "meta", begin: /^#!/, end: /$/ },
|
||||
e.APOS_STRING_MODE,
|
||||
e.QUOTE_STRING_MODE,
|
||||
i,
|
||||
e.C_LINE_COMMENT_MODE,
|
||||
e.C_BLOCK_COMMENT_MODE,
|
||||
r,
|
||||
{
|
||||
begin: /[{,]\s*/,
|
||||
relevance: 0,
|
||||
contains: [
|
||||
{
|
||||
begin: n + "\\s*:",
|
||||
returnBegin: !0,
|
||||
relevance: 0,
|
||||
contains: [{ className: "attr", begin: n, relevance: 0 }],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
begin: "(" + e.RE_STARTERS_RE + "|\\b(case|return|throw)\\b)\\s*",
|
||||
keywords: "return throw case",
|
||||
contains: [
|
||||
e.C_LINE_COMMENT_MODE,
|
||||
e.C_BLOCK_COMMENT_MODE,
|
||||
e.REGEXP_MODE,
|
||||
{
|
||||
className: "function",
|
||||
begin: "(\\(.*?\\)|" + n + ")\\s*=>",
|
||||
returnBegin: !0,
|
||||
end: "\\s*=>",
|
||||
contains: [
|
||||
{
|
||||
className: "params",
|
||||
variants: [
|
||||
{ begin: n },
|
||||
{ begin: /\(\s*\)/ },
|
||||
{
|
||||
begin: /\(/,
|
||||
end: /\)/,
|
||||
excludeBegin: !0,
|
||||
excludeEnd: !0,
|
||||
keywords: a,
|
||||
contains: t,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
begin: /</,
|
||||
end: /(\/\w+|\w+\/)>/,
|
||||
subLanguage: "xml",
|
||||
contains: [
|
||||
{ begin: /<\w+\s*\/>/, skip: !0 },
|
||||
{
|
||||
begin: /<\w+/,
|
||||
end: /(\/\w+|\w+\/)>/,
|
||||
skip: !0,
|
||||
contains: [{ begin: /<\w+\s*\/>/, skip: !0 }, "self"],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
relevance: 0,
|
||||
},
|
||||
{
|
||||
className: "function",
|
||||
beginKeywords: "function",
|
||||
end: /\{/,
|
||||
excludeEnd: !0,
|
||||
contains: [
|
||||
e.inherit(e.TITLE_MODE, { begin: n }),
|
||||
{
|
||||
className: "params",
|
||||
begin: /\(/,
|
||||
end: /\)/,
|
||||
excludeBegin: !0,
|
||||
excludeEnd: !0,
|
||||
contains: t,
|
||||
},
|
||||
],
|
||||
illegal: /\[|%/,
|
||||
},
|
||||
{ begin: /\$[(.]/ },
|
||||
e.METHOD_GUARD,
|
||||
{
|
||||
className: "class",
|
||||
beginKeywords: "class",
|
||||
end: /[{;=]/,
|
||||
excludeEnd: !0,
|
||||
illegal: /[:"\[\]]/,
|
||||
contains: [{ beginKeywords: "extends" }, e.UNDERSCORE_TITLE_MODE],
|
||||
},
|
||||
{ beginKeywords: "constructor", end: /\{/, excludeEnd: !0 },
|
||||
],
|
||||
illegal: /#(?!!)/,
|
||||
};
|
||||
};
|
||||
30
towxml/plugins/hljs/languages/json.js
Normal file
30
towxml/plugins/hljs/languages/json.js
Normal file
@@ -0,0 +1,30 @@
|
||||
module.exports = function (e) {
|
||||
var n = { literal: "true false null" },
|
||||
l = [e.QUOTE_STRING_MODE, e.C_NUMBER_MODE],
|
||||
i = {
|
||||
end: ",",
|
||||
endsWithParent: !0,
|
||||
excludeEnd: !0,
|
||||
contains: l,
|
||||
keywords: n,
|
||||
},
|
||||
t = {
|
||||
begin: "{",
|
||||
end: "}",
|
||||
contains: [
|
||||
{
|
||||
className: "attr",
|
||||
begin: /"/,
|
||||
end: /"/,
|
||||
contains: [e.BACKSLASH_ESCAPE],
|
||||
illegal: "\\n",
|
||||
},
|
||||
e.inherit(i, { begin: /:/ }),
|
||||
],
|
||||
illegal: "\\S",
|
||||
},
|
||||
a = { begin: "\\[", end: "\\]", contains: [e.inherit(i)], illegal: "\\S" };
|
||||
return (
|
||||
l.splice(l.length, 0, t, a), { contains: l, keywords: n, illegal: "\\S" }
|
||||
);
|
||||
};
|
||||
106
towxml/plugins/hljs/languages/less.js
Normal file
106
towxml/plugins/hljs/languages/less.js
Normal file
@@ -0,0 +1,106 @@
|
||||
module.exports = function (e) {
|
||||
var n = "[\\w-]+",
|
||||
a = "([\\w-]+|@{[\\w-]+})",
|
||||
t = [],
|
||||
s = [],
|
||||
r = function (e) {
|
||||
return { className: "string", begin: "~?" + e + ".*?" + e };
|
||||
},
|
||||
i = function (e, n, a) {
|
||||
return { className: e, begin: n, relevance: a };
|
||||
},
|
||||
c = { begin: "\\(", end: "\\)", contains: s, relevance: 0 };
|
||||
s.push(
|
||||
e.C_LINE_COMMENT_MODE,
|
||||
e.C_BLOCK_COMMENT_MODE,
|
||||
r("'"),
|
||||
r('"'),
|
||||
e.CSS_NUMBER_MODE,
|
||||
{
|
||||
begin: "(url|data-uri)\\(",
|
||||
starts: { className: "string", end: "[\\)\\n]", excludeEnd: !0 },
|
||||
},
|
||||
i("number", "#[0-9A-Fa-f]+\\b"),
|
||||
c,
|
||||
i("variable", "@@?" + n, 10),
|
||||
i("variable", "@{[\\w-]+}"),
|
||||
i("built_in", "~?`[^`]*?`"),
|
||||
{
|
||||
className: "attribute",
|
||||
begin: n + "\\s*:",
|
||||
end: ":",
|
||||
returnBegin: !0,
|
||||
excludeEnd: !0,
|
||||
},
|
||||
{ className: "meta", begin: "!important" }
|
||||
);
|
||||
var l = s.concat({ begin: "{", end: "}", contains: t }),
|
||||
o = {
|
||||
beginKeywords: "when",
|
||||
endsWithParent: !0,
|
||||
contains: [{ beginKeywords: "and not" }].concat(s),
|
||||
},
|
||||
d = {
|
||||
begin: a + "\\s*:",
|
||||
returnBegin: !0,
|
||||
end: "[;}]",
|
||||
relevance: 0,
|
||||
contains: [
|
||||
{
|
||||
className: "attribute",
|
||||
begin: a,
|
||||
end: ":",
|
||||
excludeEnd: !0,
|
||||
starts: {
|
||||
endsWithParent: !0,
|
||||
illegal: "[<=$]",
|
||||
relevance: 0,
|
||||
contains: s,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
b = {
|
||||
className: "keyword",
|
||||
begin:
|
||||
"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",
|
||||
starts: { end: "[;{}]", returnEnd: !0, contains: s, relevance: 0 },
|
||||
},
|
||||
g = {
|
||||
className: "variable",
|
||||
variants: [{ begin: "@[\\w-]+\\s*:", relevance: 15 }, { begin: "@" + n }],
|
||||
starts: { end: "[;}]", returnEnd: !0, contains: l },
|
||||
},
|
||||
u = {
|
||||
variants: [
|
||||
{ begin: "[\\.#:&\\[>]", end: "[;{}]" },
|
||||
{ begin: a, end: "{" },
|
||||
],
|
||||
returnBegin: !0,
|
||||
returnEnd: !0,
|
||||
illegal: "[<='$\"]",
|
||||
relevance: 0,
|
||||
contains: [
|
||||
e.C_LINE_COMMENT_MODE,
|
||||
e.C_BLOCK_COMMENT_MODE,
|
||||
o,
|
||||
i("keyword", "all\\b"),
|
||||
i("variable", "@{[\\w-]+}"),
|
||||
i("selector-tag", a + "%?", 0),
|
||||
i("selector-id", "#" + a),
|
||||
i("selector-class", "\\." + a, 0),
|
||||
i("selector-tag", "&", 0),
|
||||
{ className: "selector-attr", begin: "\\[", end: "\\]" },
|
||||
{
|
||||
className: "selector-pseudo",
|
||||
begin: /:(:)?[a-zA-Z0-9\_\-\+\(\)"'.]+/,
|
||||
},
|
||||
{ begin: "\\(", end: "\\)", contains: l },
|
||||
{ begin: "!important" },
|
||||
],
|
||||
};
|
||||
return (
|
||||
t.push(e.C_LINE_COMMENT_MODE, e.C_BLOCK_COMMENT_MODE, b, g, d, u),
|
||||
{ case_insensitive: !0, illegal: "[=>'/<($\"]", contains: t }
|
||||
);
|
||||
};
|
||||
58
towxml/plugins/hljs/languages/makefile.js
Normal file
58
towxml/plugins/hljs/languages/makefile.js
Normal file
@@ -0,0 +1,58 @@
|
||||
module.exports = function (e) {
|
||||
var i = {
|
||||
className: "variable",
|
||||
variants: [
|
||||
{
|
||||
begin: "\\$\\(" + e.UNDERSCORE_IDENT_RE + "\\)",
|
||||
contains: [e.BACKSLASH_ESCAPE],
|
||||
},
|
||||
{ begin: /\$[@%<?\^\+\*]/ },
|
||||
],
|
||||
},
|
||||
n = {
|
||||
className: "string",
|
||||
begin: /"/,
|
||||
end: /"/,
|
||||
contains: [e.BACKSLASH_ESCAPE, i],
|
||||
},
|
||||
a = {
|
||||
className: "variable",
|
||||
begin: /\$\([\w-]+\s/,
|
||||
end: /\)/,
|
||||
keywords: {
|
||||
built_in:
|
||||
"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value",
|
||||
},
|
||||
contains: [i],
|
||||
},
|
||||
s = {
|
||||
begin: "^" + e.UNDERSCORE_IDENT_RE + "\\s*[:+?]?=",
|
||||
illegal: "\\n",
|
||||
returnBegin: !0,
|
||||
contains: [
|
||||
{ begin: "^" + e.UNDERSCORE_IDENT_RE, end: "[:+?]?=", excludeEnd: !0 },
|
||||
],
|
||||
},
|
||||
r = { className: "section", begin: /^[^\s]+:/, end: /$/, contains: [i] };
|
||||
return {
|
||||
aliases: ["mk", "mak"],
|
||||
keywords:
|
||||
"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath",
|
||||
lexemes: /[\w-]+/,
|
||||
contains: [
|
||||
e.HASH_COMMENT_MODE,
|
||||
i,
|
||||
n,
|
||||
a,
|
||||
s,
|
||||
{
|
||||
className: "meta",
|
||||
begin: /^\.PHONY:/,
|
||||
end: /$/,
|
||||
keywords: { "meta-keyword": ".PHONY" },
|
||||
lexemes: /[\.\w]+/,
|
||||
},
|
||||
r,
|
||||
],
|
||||
};
|
||||
};
|
||||
81
towxml/plugins/hljs/languages/nginx.js
Normal file
81
towxml/plugins/hljs/languages/nginx.js
Normal file
@@ -0,0 +1,81 @@
|
||||
module.exports = function (e) {
|
||||
var n = {
|
||||
className: "variable",
|
||||
variants: [
|
||||
{ begin: /\$\d+/ },
|
||||
{ begin: /\$\{/, end: /}/ },
|
||||
{ begin: "[\\$\\@]" + e.UNDERSCORE_IDENT_RE },
|
||||
],
|
||||
},
|
||||
a = {
|
||||
endsWithParent: !0,
|
||||
lexemes: "[a-z/_]+",
|
||||
keywords: {
|
||||
literal:
|
||||
"on off yes no true false none blocked debug info notice warn error crit select break last permanent redirect kqueue rtsig epoll poll /dev/poll",
|
||||
},
|
||||
relevance: 0,
|
||||
illegal: "=>",
|
||||
contains: [
|
||||
e.HASH_COMMENT_MODE,
|
||||
{
|
||||
className: "string",
|
||||
contains: [e.BACKSLASH_ESCAPE, n],
|
||||
variants: [
|
||||
{ begin: /"/, end: /"/ },
|
||||
{ begin: /'/, end: /'/ },
|
||||
],
|
||||
},
|
||||
{
|
||||
begin: "([a-z]+):/",
|
||||
end: "\\s",
|
||||
endsWithParent: !0,
|
||||
excludeEnd: !0,
|
||||
contains: [n],
|
||||
},
|
||||
{
|
||||
className: "regexp",
|
||||
contains: [e.BACKSLASH_ESCAPE, n],
|
||||
variants: [
|
||||
{ begin: "\\s\\^", end: "\\s|{|;", returnEnd: !0 },
|
||||
{ begin: "~\\*?\\s+", end: "\\s|{|;", returnEnd: !0 },
|
||||
{ begin: "\\*(\\.[a-z\\-]+)+" },
|
||||
{ begin: "([a-z\\-]+\\.)+\\*" },
|
||||
],
|
||||
},
|
||||
{
|
||||
className: "number",
|
||||
begin: "\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b",
|
||||
},
|
||||
{
|
||||
className: "number",
|
||||
begin: "\\b\\d+[kKmMgGdshdwy]*\\b",
|
||||
relevance: 0,
|
||||
},
|
||||
n,
|
||||
],
|
||||
};
|
||||
return {
|
||||
aliases: ["nginxconf"],
|
||||
contains: [
|
||||
e.HASH_COMMENT_MODE,
|
||||
{
|
||||
begin: e.UNDERSCORE_IDENT_RE + "\\s+{",
|
||||
returnBegin: !0,
|
||||
end: "{",
|
||||
contains: [{ className: "section", begin: e.UNDERSCORE_IDENT_RE }],
|
||||
relevance: 0,
|
||||
},
|
||||
{
|
||||
begin: e.UNDERSCORE_IDENT_RE + "\\s",
|
||||
end: ";|{",
|
||||
returnBegin: !0,
|
||||
contains: [
|
||||
{ className: "attribute", begin: e.UNDERSCORE_IDENT_RE, starts: a },
|
||||
],
|
||||
relevance: 0,
|
||||
},
|
||||
],
|
||||
illegal: "[^\\s\\}]",
|
||||
};
|
||||
};
|
||||
76
towxml/plugins/hljs/languages/scss.js
Normal file
76
towxml/plugins/hljs/languages/scss.js
Normal file
@@ -0,0 +1,76 @@
|
||||
module.exports = function (e) {
|
||||
var t = { className: "variable", begin: "(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b" },
|
||||
i = { className: "number", begin: "#[0-9A-Fa-f]+" };
|
||||
return (
|
||||
e.CSS_NUMBER_MODE,
|
||||
e.QUOTE_STRING_MODE,
|
||||
e.APOS_STRING_MODE,
|
||||
e.C_BLOCK_COMMENT_MODE,
|
||||
{
|
||||
case_insensitive: !0,
|
||||
illegal: "[=/|']",
|
||||
contains: [
|
||||
e.C_LINE_COMMENT_MODE,
|
||||
e.C_BLOCK_COMMENT_MODE,
|
||||
{ className: "selector-id", begin: "\\#[A-Za-z0-9_-]+", relevance: 0 },
|
||||
{
|
||||
className: "selector-class",
|
||||
begin: "\\.[A-Za-z0-9_-]+",
|
||||
relevance: 0,
|
||||
},
|
||||
{ className: "selector-attr", begin: "\\[", end: "\\]", illegal: "$" },
|
||||
{
|
||||
className: "selector-tag",
|
||||
begin:
|
||||
"\\b(a|abbr|acronym|address|area|article|aside|audio|b|base|big|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|command|datalist|dd|del|details|dfn|div|dl|dt|em|embed|fieldset|figcaption|figure|footer|form|frame|frameset|(h[1-6])|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|keygen|label|legend|li|link|map|mark|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|rp|rt|ruby|samp|script|section|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|tt|ul|var|video)\\b",
|
||||
relevance: 0,
|
||||
},
|
||||
{
|
||||
begin:
|
||||
":(visited|valid|root|right|required|read-write|read-only|out-range|optional|only-of-type|only-child|nth-of-type|nth-last-of-type|nth-last-child|nth-child|not|link|left|last-of-type|last-child|lang|invalid|indeterminate|in-range|hover|focus|first-of-type|first-line|first-letter|first-child|first|enabled|empty|disabled|default|checked|before|after|active)",
|
||||
},
|
||||
{
|
||||
begin:
|
||||
"::(after|before|choices|first-letter|first-line|repeat-index|repeat-item|selection|value)",
|
||||
},
|
||||
t,
|
||||
{
|
||||
className: "attribute",
|
||||
begin:
|
||||
"\\b(z-index|word-wrap|word-spacing|word-break|width|widows|white-space|visibility|vertical-align|unicode-bidi|transition-timing-function|transition-property|transition-duration|transition-delay|transition|transform-style|transform-origin|transform|top|text-underline-position|text-transform|text-shadow|text-rendering|text-overflow|text-indent|text-decoration-style|text-decoration-line|text-decoration-color|text-decoration|text-align-last|text-align|tab-size|table-layout|right|resize|quotes|position|pointer-events|perspective-origin|perspective|page-break-inside|page-break-before|page-break-after|padding-top|padding-right|padding-left|padding-bottom|padding|overflow-y|overflow-x|overflow-wrap|overflow|outline-width|outline-style|outline-offset|outline-color|outline|orphans|order|opacity|object-position|object-fit|normal|none|nav-up|nav-right|nav-left|nav-index|nav-down|min-width|min-height|max-width|max-height|mask|marks|margin-top|margin-right|margin-left|margin-bottom|margin|list-style-type|list-style-position|list-style-image|list-style|line-height|letter-spacing|left|justify-content|initial|inherit|ime-mode|image-orientation|image-resolution|image-rendering|icon|hyphens|height|font-weight|font-variant-ligatures|font-variant|font-style|font-stretch|font-size-adjust|font-size|font-language-override|font-kerning|font-feature-settings|font-family|font|float|flex-wrap|flex-shrink|flex-grow|flex-flow|flex-direction|flex-basis|flex|filter|empty-cells|display|direction|cursor|counter-reset|counter-increment|content|column-width|column-span|column-rule-width|column-rule-style|column-rule-color|column-rule|column-gap|column-fill|column-count|columns|color|clip-path|clip|clear|caption-side|break-inside|break-before|break-after|box-sizing|box-shadow|box-decoration-break|bottom|border-width|border-top-width|border-top-style|border-top-right-radius|border-top-left-radius|border-top-color|border-top|border-style|border-spacing|border-right-width|border-right-style|border-right-color|border-right|border-radius|border-left-width|border-left-style|border-left-color|border-left|border-image-width|border-image-source|border-image-slice|border-image-repeat|border-image-outset|border-image|border-color|border-collapse|border-bottom-width|border-bottom-style|border-bottom-right-radius|border-bottom-left-radius|border-bottom-color|border-bottom|border|background-size|background-repeat|background-position|background-origin|background-image|background-color|background-clip|background-attachment|background-blend-mode|background|backface-visibility|auto|animation-timing-function|animation-play-state|animation-name|animation-iteration-count|animation-fill-mode|animation-duration|animation-direction|animation-delay|animation|align-self|align-items|align-content)\\b",
|
||||
illegal: "[^\\s]",
|
||||
},
|
||||
{
|
||||
begin:
|
||||
"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b",
|
||||
},
|
||||
{
|
||||
begin: ":",
|
||||
end: ";",
|
||||
contains: [
|
||||
t,
|
||||
i,
|
||||
e.CSS_NUMBER_MODE,
|
||||
e.QUOTE_STRING_MODE,
|
||||
e.APOS_STRING_MODE,
|
||||
{ className: "meta", begin: "!important" },
|
||||
],
|
||||
},
|
||||
{
|
||||
begin: "@",
|
||||
end: "[{;]",
|
||||
keywords:
|
||||
"mixin include extend for if else each while charset import debug media page content font-face namespace warn",
|
||||
contains: [
|
||||
t,
|
||||
e.QUOTE_STRING_MODE,
|
||||
e.APOS_STRING_MODE,
|
||||
i,
|
||||
e.CSS_NUMBER_MODE,
|
||||
{ begin: "\\s[A-Za-z0-9_.-]+", relevance: 0 },
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
);
|
||||
};
|
||||
48
towxml/plugins/hljs/languages/sql.js
Normal file
48
towxml/plugins/hljs/languages/sql.js
Normal file
File diff suppressed because one or more lines are too long
127
towxml/plugins/hljs/languages/typescript.js
Normal file
127
towxml/plugins/hljs/languages/typescript.js
Normal file
@@ -0,0 +1,127 @@
|
||||
module.exports = function (e) {
|
||||
var n = {
|
||||
keyword:
|
||||
"in if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const class public private protected get set super static implements enum export import declare type namespace abstract as from extends async await",
|
||||
literal: "true false null undefined NaN Infinity",
|
||||
built_in:
|
||||
"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document any number boolean string void Promise",
|
||||
};
|
||||
return {
|
||||
aliases: ["ts"],
|
||||
keywords: n,
|
||||
contains: [
|
||||
{ className: "meta", begin: /^\s*['"]use strict['"]/ },
|
||||
e.APOS_STRING_MODE,
|
||||
e.QUOTE_STRING_MODE,
|
||||
{
|
||||
className: "string",
|
||||
begin: "`",
|
||||
end: "`",
|
||||
contains: [
|
||||
e.BACKSLASH_ESCAPE,
|
||||
{ className: "subst", begin: "\\$\\{", end: "\\}" },
|
||||
],
|
||||
},
|
||||
e.C_LINE_COMMENT_MODE,
|
||||
e.C_BLOCK_COMMENT_MODE,
|
||||
{
|
||||
className: "number",
|
||||
variants: [
|
||||
{ begin: "\\b(0[bB][01]+)" },
|
||||
{ begin: "\\b(0[oO][0-7]+)" },
|
||||
{ begin: e.C_NUMBER_RE },
|
||||
],
|
||||
relevance: 0,
|
||||
},
|
||||
{
|
||||
begin: "(" + e.RE_STARTERS_RE + "|\\b(case|return|throw)\\b)\\s*",
|
||||
keywords: "return throw case",
|
||||
contains: [
|
||||
e.C_LINE_COMMENT_MODE,
|
||||
e.C_BLOCK_COMMENT_MODE,
|
||||
e.REGEXP_MODE,
|
||||
{
|
||||
className: "function",
|
||||
begin: "(\\(.*?\\)|" + e.IDENT_RE + ")\\s*=>",
|
||||
returnBegin: !0,
|
||||
end: "\\s*=>",
|
||||
contains: [
|
||||
{
|
||||
className: "params",
|
||||
variants: [
|
||||
{ begin: e.IDENT_RE },
|
||||
{ begin: /\(\s*\)/ },
|
||||
{
|
||||
begin: /\(/,
|
||||
end: /\)/,
|
||||
excludeBegin: !0,
|
||||
excludeEnd: !0,
|
||||
keywords: n,
|
||||
contains: [
|
||||
"self",
|
||||
e.C_LINE_COMMENT_MODE,
|
||||
e.C_BLOCK_COMMENT_MODE,
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
relevance: 0,
|
||||
},
|
||||
{
|
||||
className: "function",
|
||||
begin: "function",
|
||||
end: /[\{;]/,
|
||||
excludeEnd: !0,
|
||||
keywords: n,
|
||||
contains: [
|
||||
"self",
|
||||
e.inherit(e.TITLE_MODE, { begin: /[A-Za-z$_][0-9A-Za-z$_]*/ }),
|
||||
{
|
||||
className: "params",
|
||||
begin: /\(/,
|
||||
end: /\)/,
|
||||
excludeBegin: !0,
|
||||
excludeEnd: !0,
|
||||
keywords: n,
|
||||
contains: [e.C_LINE_COMMENT_MODE, e.C_BLOCK_COMMENT_MODE],
|
||||
illegal: /["'\(]/,
|
||||
},
|
||||
],
|
||||
illegal: /%/,
|
||||
relevance: 0,
|
||||
},
|
||||
{
|
||||
beginKeywords: "constructor",
|
||||
end: /\{/,
|
||||
excludeEnd: !0,
|
||||
contains: [
|
||||
"self",
|
||||
{
|
||||
className: "params",
|
||||
begin: /\(/,
|
||||
end: /\)/,
|
||||
excludeBegin: !0,
|
||||
excludeEnd: !0,
|
||||
keywords: n,
|
||||
contains: [e.C_LINE_COMMENT_MODE, e.C_BLOCK_COMMENT_MODE],
|
||||
illegal: /["'\(]/,
|
||||
},
|
||||
],
|
||||
},
|
||||
{ begin: /module\./, keywords: { built_in: "module" }, relevance: 0 },
|
||||
{ beginKeywords: "module", end: /\{/, excludeEnd: !0 },
|
||||
{
|
||||
beginKeywords: "interface",
|
||||
end: /\{/,
|
||||
excludeEnd: !0,
|
||||
keywords: "interface extends",
|
||||
},
|
||||
{ begin: /\$[(.]/ },
|
||||
{ begin: "\\." + e.IDENT_RE, relevance: 0 },
|
||||
{ className: "meta", begin: "@[A-Za-z]+" },
|
||||
],
|
||||
};
|
||||
};
|
||||
147
towxml/plugins/markdown-it-ins.js
Normal file
147
towxml/plugins/markdown-it-ins.js
Normal file
@@ -0,0 +1,147 @@
|
||||
var e;
|
||||
(e =
|
||||
"function" == typeof Symbol && "symbol" == typeof Symbol.iterator
|
||||
? function (e) {
|
||||
return typeof e;
|
||||
}
|
||||
: function (e) {
|
||||
return e &&
|
||||
"function" == typeof Symbol &&
|
||||
e.constructor === Symbol &&
|
||||
e !== Symbol.prototype
|
||||
? "symbol"
|
||||
: typeof e;
|
||||
}),
|
||||
(function (n) {
|
||||
"object" == ("undefined" == typeof exports ? "undefined" : e(exports)) &&
|
||||
"undefined" != typeof module
|
||||
? (module.exports = n())
|
||||
: "function" == typeof define && define.amd
|
||||
? define([], n)
|
||||
: (("undefined" != typeof window
|
||||
? window
|
||||
: "undefined" != typeof global
|
||||
? global
|
||||
: "undefined" != typeof self
|
||||
? self
|
||||
: this
|
||||
).markdownitIns = n());
|
||||
})(function () {
|
||||
return (function e(n, t, o) {
|
||||
function r(f, s) {
|
||||
if (!t[f]) {
|
||||
if (!n[f]) {
|
||||
var u = "function" == typeof require && require;
|
||||
if (!s && u) return u(f, !0);
|
||||
if (i) return i(f, !0);
|
||||
var p = new Error("Cannot find module '" + f + "'");
|
||||
throw ((p.code = "MODULE_NOT_FOUND"), p);
|
||||
}
|
||||
var l = (t[f] = { exports: {} });
|
||||
n[f][0].call(
|
||||
l.exports,
|
||||
function (e) {
|
||||
return r(n[f][1][e] || e);
|
||||
},
|
||||
l,
|
||||
l.exports,
|
||||
e,
|
||||
n,
|
||||
t,
|
||||
o
|
||||
);
|
||||
}
|
||||
return t[f].exports;
|
||||
}
|
||||
for (
|
||||
var i = "function" == typeof require && require, f = 0;
|
||||
f < o.length;
|
||||
f++
|
||||
)
|
||||
r(o[f]);
|
||||
return r;
|
||||
})(
|
||||
{
|
||||
1: [
|
||||
function (e, n, t) {
|
||||
n.exports = function (e) {
|
||||
e.inline.ruler.before("emphasis", "ins", function (e, n) {
|
||||
var t,
|
||||
o,
|
||||
r,
|
||||
i,
|
||||
f = e.pos,
|
||||
s = e.src.charCodeAt(f);
|
||||
if (n) return !1;
|
||||
if (43 !== s) return !1;
|
||||
if (
|
||||
((r = (o = e.scanDelims(e.pos, !0)).length),
|
||||
(i = String.fromCharCode(s)),
|
||||
2 > r)
|
||||
)
|
||||
return !1;
|
||||
for (
|
||||
r % 2 && ((e.push("text", "", 0).content = i), r--), t = 0;
|
||||
r > t;
|
||||
t += 2
|
||||
)
|
||||
(e.push("text", "", 0).content = i + i),
|
||||
e.delimiters.push({
|
||||
marker: s,
|
||||
jump: t,
|
||||
token: e.tokens.length - 1,
|
||||
level: e.level,
|
||||
end: -1,
|
||||
open: o.can_open,
|
||||
close: o.can_close,
|
||||
});
|
||||
return (e.pos += o.length), !0;
|
||||
}),
|
||||
e.inline.ruler2.before("emphasis", "ins", function (e) {
|
||||
var n,
|
||||
t,
|
||||
o,
|
||||
r,
|
||||
i,
|
||||
f = [],
|
||||
s = e.delimiters,
|
||||
u = e.delimiters.length;
|
||||
for (n = 0; u > n; n++)
|
||||
43 === (o = s[n]).marker &&
|
||||
-1 !== o.end &&
|
||||
((r = s[o.end]),
|
||||
((i = e.tokens[o.token]).type = "ins_open"),
|
||||
(i.tag = "ins"),
|
||||
(i.nesting = 1),
|
||||
(i.markup = "++"),
|
||||
(i.content = ""),
|
||||
((i = e.tokens[r.token]).type = "ins_close"),
|
||||
(i.tag = "ins"),
|
||||
(i.nesting = -1),
|
||||
(i.markup = "++"),
|
||||
(i.content = ""),
|
||||
"text" === e.tokens[r.token - 1].type &&
|
||||
"+" === e.tokens[r.token - 1].content &&
|
||||
f.push(r.token - 1));
|
||||
for (; f.length; ) {
|
||||
for (
|
||||
t = (n = f.pop()) + 1;
|
||||
t < e.tokens.length && "ins_close" === e.tokens[t].type;
|
||||
|
||||
)
|
||||
t++;
|
||||
n !== --t &&
|
||||
((i = e.tokens[t]),
|
||||
(e.tokens[t] = e.tokens[n]),
|
||||
(e.tokens[n] = i));
|
||||
}
|
||||
});
|
||||
};
|
||||
},
|
||||
{},
|
||||
],
|
||||
},
|
||||
{},
|
||||
[1]
|
||||
)(1);
|
||||
});
|
||||
147
towxml/plugins/markdown-it-mark.js
Normal file
147
towxml/plugins/markdown-it-mark.js
Normal file
@@ -0,0 +1,147 @@
|
||||
var e;
|
||||
(e =
|
||||
"function" == typeof Symbol && "symbol" == typeof Symbol.iterator
|
||||
? function (e) {
|
||||
return typeof e;
|
||||
}
|
||||
: function (e) {
|
||||
return e &&
|
||||
"function" == typeof Symbol &&
|
||||
e.constructor === Symbol &&
|
||||
e !== Symbol.prototype
|
||||
? "symbol"
|
||||
: typeof e;
|
||||
}),
|
||||
(function (n) {
|
||||
"object" == ("undefined" == typeof exports ? "undefined" : e(exports)) &&
|
||||
"undefined" != typeof module
|
||||
? (module.exports = n())
|
||||
: "function" == typeof define && define.amd
|
||||
? define([], n)
|
||||
: (("undefined" != typeof window
|
||||
? window
|
||||
: "undefined" != typeof global
|
||||
? global
|
||||
: "undefined" != typeof self
|
||||
? self
|
||||
: this
|
||||
).markdownitMark = n());
|
||||
})(function () {
|
||||
return (function e(n, t, o) {
|
||||
function r(f, u) {
|
||||
if (!t[f]) {
|
||||
if (!n[f]) {
|
||||
var s = "function" == typeof require && require;
|
||||
if (!u && s) return s(f, !0);
|
||||
if (i) return i(f, !0);
|
||||
var p = new Error("Cannot find module '" + f + "'");
|
||||
throw ((p.code = "MODULE_NOT_FOUND"), p);
|
||||
}
|
||||
var l = (t[f] = { exports: {} });
|
||||
n[f][0].call(
|
||||
l.exports,
|
||||
function (e) {
|
||||
return r(n[f][1][e] || e);
|
||||
},
|
||||
l,
|
||||
l.exports,
|
||||
e,
|
||||
n,
|
||||
t,
|
||||
o
|
||||
);
|
||||
}
|
||||
return t[f].exports;
|
||||
}
|
||||
for (
|
||||
var i = "function" == typeof require && require, f = 0;
|
||||
f < o.length;
|
||||
f++
|
||||
)
|
||||
r(o[f]);
|
||||
return r;
|
||||
})(
|
||||
{
|
||||
1: [
|
||||
function (e, n, t) {
|
||||
n.exports = function (e) {
|
||||
e.inline.ruler.before("emphasis", "mark", function (e, n) {
|
||||
var t,
|
||||
o,
|
||||
r,
|
||||
i,
|
||||
f = e.pos,
|
||||
u = e.src.charCodeAt(f);
|
||||
if (n) return !1;
|
||||
if (61 !== u) return !1;
|
||||
if (
|
||||
((r = (o = e.scanDelims(e.pos, !0)).length),
|
||||
(i = String.fromCharCode(u)),
|
||||
2 > r)
|
||||
)
|
||||
return !1;
|
||||
for (
|
||||
r % 2 && ((e.push("text", "", 0).content = i), r--), t = 0;
|
||||
r > t;
|
||||
t += 2
|
||||
)
|
||||
(e.push("text", "", 0).content = i + i),
|
||||
e.delimiters.push({
|
||||
marker: u,
|
||||
jump: t,
|
||||
token: e.tokens.length - 1,
|
||||
level: e.level,
|
||||
end: -1,
|
||||
open: o.can_open,
|
||||
close: o.can_close,
|
||||
});
|
||||
return (e.pos += o.length), !0;
|
||||
}),
|
||||
e.inline.ruler2.before("emphasis", "mark", function (e) {
|
||||
var n,
|
||||
t,
|
||||
o,
|
||||
r,
|
||||
i,
|
||||
f = [],
|
||||
u = e.delimiters,
|
||||
s = e.delimiters.length;
|
||||
for (n = 0; s > n; n++)
|
||||
61 === (o = u[n]).marker &&
|
||||
-1 !== o.end &&
|
||||
((r = u[o.end]),
|
||||
((i = e.tokens[o.token]).type = "mark_open"),
|
||||
(i.tag = "mark"),
|
||||
(i.nesting = 1),
|
||||
(i.markup = "=="),
|
||||
(i.content = ""),
|
||||
((i = e.tokens[r.token]).type = "mark_close"),
|
||||
(i.tag = "mark"),
|
||||
(i.nesting = -1),
|
||||
(i.markup = "=="),
|
||||
(i.content = ""),
|
||||
"text" === e.tokens[r.token - 1].type &&
|
||||
"=" === e.tokens[r.token - 1].content &&
|
||||
f.push(r.token - 1));
|
||||
for (; f.length; ) {
|
||||
for (
|
||||
t = (n = f.pop()) + 1;
|
||||
t < e.tokens.length && "mark_close" === e.tokens[t].type;
|
||||
|
||||
)
|
||||
t++;
|
||||
n !== --t &&
|
||||
((i = e.tokens[t]),
|
||||
(e.tokens[t] = e.tokens[n]),
|
||||
(e.tokens[n] = i));
|
||||
}
|
||||
});
|
||||
};
|
||||
},
|
||||
{},
|
||||
],
|
||||
},
|
||||
{},
|
||||
[1]
|
||||
)(1);
|
||||
});
|
||||
106
towxml/plugins/markdown-it-sub.js
Normal file
106
towxml/plugins/markdown-it-sub.js
Normal file
@@ -0,0 +1,106 @@
|
||||
var e;
|
||||
(e =
|
||||
"function" == typeof Symbol && "symbol" == typeof Symbol.iterator
|
||||
? function (e) {
|
||||
return typeof e;
|
||||
}
|
||||
: function (e) {
|
||||
return e &&
|
||||
"function" == typeof Symbol &&
|
||||
e.constructor === Symbol &&
|
||||
e !== Symbol.prototype
|
||||
? "symbol"
|
||||
: typeof e;
|
||||
}),
|
||||
(function (o) {
|
||||
"object" == ("undefined" == typeof exports ? "undefined" : e(exports)) &&
|
||||
"undefined" != typeof module
|
||||
? (module.exports = o())
|
||||
: "function" == typeof define && define.amd
|
||||
? define([], o)
|
||||
: (("undefined" != typeof window
|
||||
? window
|
||||
: "undefined" != typeof global
|
||||
? global
|
||||
: "undefined" != typeof self
|
||||
? self
|
||||
: this
|
||||
).markdownitSub = o());
|
||||
})(function () {
|
||||
return (function e(o, n, r) {
|
||||
function t(f, i) {
|
||||
if (!n[f]) {
|
||||
if (!o[f]) {
|
||||
var p = "function" == typeof require && require;
|
||||
if (!i && p) return p(f, !0);
|
||||
if (u) return u(f, !0);
|
||||
var s = new Error("Cannot find module '" + f + "'");
|
||||
throw ((s.code = "MODULE_NOT_FOUND"), s);
|
||||
}
|
||||
var c = (n[f] = { exports: {} });
|
||||
o[f][0].call(
|
||||
c.exports,
|
||||
function (e) {
|
||||
return t(o[f][1][e] || e);
|
||||
},
|
||||
c,
|
||||
c.exports,
|
||||
e,
|
||||
o,
|
||||
n,
|
||||
r
|
||||
);
|
||||
}
|
||||
return n[f].exports;
|
||||
}
|
||||
for (
|
||||
var u = "function" == typeof require && require, f = 0;
|
||||
f < r.length;
|
||||
f++
|
||||
)
|
||||
t(r[f]);
|
||||
return t;
|
||||
})(
|
||||
{
|
||||
1: [
|
||||
function (e, o) {
|
||||
function n(e, o) {
|
||||
var n,
|
||||
t,
|
||||
u = e.posMax,
|
||||
f = e.pos;
|
||||
if (126 !== e.src.charCodeAt(f)) return !1;
|
||||
if (o) return !1;
|
||||
if (f + 2 >= u) return !1;
|
||||
for (e.pos = f + 1; e.pos < u; ) {
|
||||
if (126 === e.src.charCodeAt(e.pos)) {
|
||||
n = !0;
|
||||
break;
|
||||
}
|
||||
e.md.inline.skipToken(e);
|
||||
}
|
||||
return n && f + 1 !== e.pos
|
||||
? (t = e.src.slice(f + 1, e.pos)).match(/(^|[^\\])(\\\\)*\s/)
|
||||
? ((e.pos = f), !1)
|
||||
: ((e.posMax = e.pos),
|
||||
(e.pos = f + 1),
|
||||
(e.push("sub_open", "sub", 1).markup = "~"),
|
||||
(e.push("text", "", 0).content = t.replace(r, "$1")),
|
||||
(e.push("sub_close", "sub", -1).markup = "~"),
|
||||
(e.pos = e.posMax + 1),
|
||||
(e.posMax = u),
|
||||
!0)
|
||||
: ((e.pos = f), !1);
|
||||
}
|
||||
var r = /\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;
|
||||
o.exports = function (e) {
|
||||
e.inline.ruler.after("emphasis", "sub", n);
|
||||
};
|
||||
},
|
||||
{},
|
||||
],
|
||||
},
|
||||
{},
|
||||
[1]
|
||||
)(1);
|
||||
});
|
||||
106
towxml/plugins/markdown-it-sup.js
Normal file
106
towxml/plugins/markdown-it-sup.js
Normal file
@@ -0,0 +1,106 @@
|
||||
var e;
|
||||
(e =
|
||||
"function" == typeof Symbol && "symbol" == typeof Symbol.iterator
|
||||
? function (e) {
|
||||
return typeof e;
|
||||
}
|
||||
: function (e) {
|
||||
return e &&
|
||||
"function" == typeof Symbol &&
|
||||
e.constructor === Symbol &&
|
||||
e !== Symbol.prototype
|
||||
? "symbol"
|
||||
: typeof e;
|
||||
}),
|
||||
(function (o) {
|
||||
"object" == ("undefined" == typeof exports ? "undefined" : e(exports)) &&
|
||||
"undefined" != typeof module
|
||||
? (module.exports = o())
|
||||
: "function" == typeof define && define.amd
|
||||
? define([], o)
|
||||
: (("undefined" != typeof window
|
||||
? window
|
||||
: "undefined" != typeof global
|
||||
? global
|
||||
: "undefined" != typeof self
|
||||
? self
|
||||
: this
|
||||
).markdownitSup = o());
|
||||
})(function () {
|
||||
return (function e(o, n, r) {
|
||||
function t(u, f) {
|
||||
if (!n[u]) {
|
||||
if (!o[u]) {
|
||||
var i = "function" == typeof require && require;
|
||||
if (!f && i) return i(u, !0);
|
||||
if (p) return p(u, !0);
|
||||
var s = new Error("Cannot find module '" + u + "'");
|
||||
throw ((s.code = "MODULE_NOT_FOUND"), s);
|
||||
}
|
||||
var c = (n[u] = { exports: {} });
|
||||
o[u][0].call(
|
||||
c.exports,
|
||||
function (e) {
|
||||
return t(o[u][1][e] || e);
|
||||
},
|
||||
c,
|
||||
c.exports,
|
||||
e,
|
||||
o,
|
||||
n,
|
||||
r
|
||||
);
|
||||
}
|
||||
return n[u].exports;
|
||||
}
|
||||
for (
|
||||
var p = "function" == typeof require && require, u = 0;
|
||||
u < r.length;
|
||||
u++
|
||||
)
|
||||
t(r[u]);
|
||||
return t;
|
||||
})(
|
||||
{
|
||||
1: [
|
||||
function (e, o) {
|
||||
function n(e, o) {
|
||||
var n,
|
||||
t,
|
||||
p = e.posMax,
|
||||
u = e.pos;
|
||||
if (94 !== e.src.charCodeAt(u)) return !1;
|
||||
if (o) return !1;
|
||||
if (u + 2 >= p) return !1;
|
||||
for (e.pos = u + 1; e.pos < p; ) {
|
||||
if (94 === e.src.charCodeAt(e.pos)) {
|
||||
n = !0;
|
||||
break;
|
||||
}
|
||||
e.md.inline.skipToken(e);
|
||||
}
|
||||
return n && u + 1 !== e.pos
|
||||
? (t = e.src.slice(u + 1, e.pos)).match(/(^|[^\\])(\\\\)*\s/)
|
||||
? ((e.pos = u), !1)
|
||||
: ((e.posMax = e.pos),
|
||||
(e.pos = u + 1),
|
||||
(e.push("sup_open", "sup", 1).markup = "^"),
|
||||
(e.push("text", "", 0).content = t.replace(r, "$1")),
|
||||
(e.push("sup_close", "sup", -1).markup = "^"),
|
||||
(e.pos = e.posMax + 1),
|
||||
(e.posMax = p),
|
||||
!0)
|
||||
: ((e.pos = u), !1);
|
||||
}
|
||||
var r = /\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;
|
||||
o.exports = function (e) {
|
||||
e.inline.ruler.after("emphasis", "sup", n);
|
||||
};
|
||||
},
|
||||
{},
|
||||
],
|
||||
},
|
||||
{},
|
||||
[1]
|
||||
)(1);
|
||||
});
|
||||
Reference in New Issue
Block a user