You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2479 lines
92 KiB
2479 lines
92 KiB
(self["webpackChunk"] = self["webpackChunk"] || []).push([[2360],{
|
|
|
|
/***/ 99498:
|
|
/*!*********************************************************************************!*\
|
|
!*** ./node_modules/_codemirror@5.58.2@codemirror/addon/display/placeholder.js ***!
|
|
\*********************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
// Distributed under an MIT license: https://codemirror.net/LICENSE
|
|
|
|
(function(mod) {
|
|
if (true) // CommonJS
|
|
mod(__webpack_require__(/*! ../../lib/codemirror */ 89780));
|
|
else {}
|
|
})(function(CodeMirror) {
|
|
CodeMirror.defineOption("placeholder", "", function(cm, val, old) {
|
|
var prev = old && old != CodeMirror.Init;
|
|
if (val && !prev) {
|
|
cm.on("blur", onBlur);
|
|
cm.on("change", onChange);
|
|
cm.on("swapDoc", onChange);
|
|
CodeMirror.on(cm.getInputField(), "compositionupdate", cm.state.placeholderCompose = function() { onComposition(cm) })
|
|
onChange(cm);
|
|
} else if (!val && prev) {
|
|
cm.off("blur", onBlur);
|
|
cm.off("change", onChange);
|
|
cm.off("swapDoc", onChange);
|
|
CodeMirror.off(cm.getInputField(), "compositionupdate", cm.state.placeholderCompose)
|
|
clearPlaceholder(cm);
|
|
var wrapper = cm.getWrapperElement();
|
|
wrapper.className = wrapper.className.replace(" CodeMirror-empty", "");
|
|
}
|
|
|
|
if (val && !cm.hasFocus()) onBlur(cm);
|
|
});
|
|
|
|
function clearPlaceholder(cm) {
|
|
if (cm.state.placeholder) {
|
|
cm.state.placeholder.parentNode.removeChild(cm.state.placeholder);
|
|
cm.state.placeholder = null;
|
|
}
|
|
}
|
|
function setPlaceholder(cm) {
|
|
clearPlaceholder(cm);
|
|
var elt = cm.state.placeholder = document.createElement("pre");
|
|
elt.style.cssText = "height: 0; overflow: visible";
|
|
elt.style.direction = cm.getOption("direction");
|
|
elt.className = "CodeMirror-placeholder CodeMirror-line-like";
|
|
var placeHolder = cm.getOption("placeholder")
|
|
if (typeof placeHolder == "string") placeHolder = document.createTextNode(placeHolder)
|
|
elt.appendChild(placeHolder)
|
|
cm.display.lineSpace.insertBefore(elt, cm.display.lineSpace.firstChild);
|
|
}
|
|
|
|
function onComposition(cm) {
|
|
setTimeout(function() {
|
|
var empty = false, input = cm.getInputField()
|
|
if (input.nodeName == "TEXTAREA")
|
|
empty = !input.value
|
|
else if (cm.lineCount() == 1)
|
|
empty = !/[^\u200b]/.test(input.querySelector(".CodeMirror-line").textContent)
|
|
if (empty) setPlaceholder(cm)
|
|
else clearPlaceholder(cm)
|
|
}, 20)
|
|
}
|
|
|
|
function onBlur(cm) {
|
|
if (isEmpty(cm)) setPlaceholder(cm);
|
|
}
|
|
function onChange(cm) {
|
|
var wrapper = cm.getWrapperElement(), empty = isEmpty(cm);
|
|
wrapper.className = wrapper.className.replace(" CodeMirror-empty", "") + (empty ? " CodeMirror-empty" : "");
|
|
|
|
if (empty) setPlaceholder(cm);
|
|
else clearPlaceholder(cm);
|
|
}
|
|
|
|
function isEmpty(cm) {
|
|
return (cm.lineCount() === 1) && (cm.getLine(0) === "");
|
|
}
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 25717:
|
|
/*!********************************************************************************!*\
|
|
!*** ./node_modules/_codemirror@5.58.2@codemirror/addon/edit/closebrackets.js ***!
|
|
\********************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
// Distributed under an MIT license: https://codemirror.net/LICENSE
|
|
|
|
(function(mod) {
|
|
if (true) // CommonJS
|
|
mod(__webpack_require__(/*! ../../lib/codemirror */ 89780));
|
|
else {}
|
|
})(function(CodeMirror) {
|
|
var defaults = {
|
|
pairs: "()[]{}''\"\"",
|
|
closeBefore: ")]}'\":;>",
|
|
triples: "",
|
|
explode: "[]{}"
|
|
};
|
|
|
|
var Pos = CodeMirror.Pos;
|
|
|
|
CodeMirror.defineOption("autoCloseBrackets", false, function(cm, val, old) {
|
|
if (old && old != CodeMirror.Init) {
|
|
cm.removeKeyMap(keyMap);
|
|
cm.state.closeBrackets = null;
|
|
}
|
|
if (val) {
|
|
ensureBound(getOption(val, "pairs"))
|
|
cm.state.closeBrackets = val;
|
|
cm.addKeyMap(keyMap);
|
|
}
|
|
});
|
|
|
|
function getOption(conf, name) {
|
|
if (name == "pairs" && typeof conf == "string") return conf;
|
|
if (typeof conf == "object" && conf[name] != null) return conf[name];
|
|
return defaults[name];
|
|
}
|
|
|
|
var keyMap = {Backspace: handleBackspace, Enter: handleEnter};
|
|
function ensureBound(chars) {
|
|
for (var i = 0; i < chars.length; i++) {
|
|
var ch = chars.charAt(i), key = "'" + ch + "'"
|
|
if (!keyMap[key]) keyMap[key] = handler(ch)
|
|
}
|
|
}
|
|
ensureBound(defaults.pairs + "`")
|
|
|
|
function handler(ch) {
|
|
return function(cm) { return handleChar(cm, ch); };
|
|
}
|
|
|
|
function getConfig(cm) {
|
|
var deflt = cm.state.closeBrackets;
|
|
if (!deflt || deflt.override) return deflt;
|
|
var mode = cm.getModeAt(cm.getCursor());
|
|
return mode.closeBrackets || deflt;
|
|
}
|
|
|
|
function handleBackspace(cm) {
|
|
var conf = getConfig(cm);
|
|
if (!conf || cm.getOption("disableInput")) return CodeMirror.Pass;
|
|
|
|
var pairs = getOption(conf, "pairs");
|
|
var ranges = cm.listSelections();
|
|
for (var i = 0; i < ranges.length; i++) {
|
|
if (!ranges[i].empty()) return CodeMirror.Pass;
|
|
var around = charsAround(cm, ranges[i].head);
|
|
if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass;
|
|
}
|
|
for (var i = ranges.length - 1; i >= 0; i--) {
|
|
var cur = ranges[i].head;
|
|
cm.replaceRange("", Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1), "+delete");
|
|
}
|
|
}
|
|
|
|
function handleEnter(cm) {
|
|
var conf = getConfig(cm);
|
|
var explode = conf && getOption(conf, "explode");
|
|
if (!explode || cm.getOption("disableInput")) return CodeMirror.Pass;
|
|
|
|
var ranges = cm.listSelections();
|
|
for (var i = 0; i < ranges.length; i++) {
|
|
if (!ranges[i].empty()) return CodeMirror.Pass;
|
|
var around = charsAround(cm, ranges[i].head);
|
|
if (!around || explode.indexOf(around) % 2 != 0) return CodeMirror.Pass;
|
|
}
|
|
cm.operation(function() {
|
|
var linesep = cm.lineSeparator() || "\n";
|
|
cm.replaceSelection(linesep + linesep, null);
|
|
cm.execCommand("goCharLeft");
|
|
ranges = cm.listSelections();
|
|
for (var i = 0; i < ranges.length; i++) {
|
|
var line = ranges[i].head.line;
|
|
cm.indentLine(line, null, true);
|
|
cm.indentLine(line + 1, null, true);
|
|
}
|
|
});
|
|
}
|
|
|
|
function contractSelection(sel) {
|
|
var inverted = CodeMirror.cmpPos(sel.anchor, sel.head) > 0;
|
|
return {anchor: new Pos(sel.anchor.line, sel.anchor.ch + (inverted ? -1 : 1)),
|
|
head: new Pos(sel.head.line, sel.head.ch + (inverted ? 1 : -1))};
|
|
}
|
|
|
|
function handleChar(cm, ch) {
|
|
var conf = getConfig(cm);
|
|
if (!conf || cm.getOption("disableInput")) return CodeMirror.Pass;
|
|
|
|
var pairs = getOption(conf, "pairs");
|
|
var pos = pairs.indexOf(ch);
|
|
if (pos == -1) return CodeMirror.Pass;
|
|
|
|
var closeBefore = getOption(conf,"closeBefore");
|
|
|
|
var triples = getOption(conf, "triples");
|
|
|
|
var identical = pairs.charAt(pos + 1) == ch;
|
|
var ranges = cm.listSelections();
|
|
var opening = pos % 2 == 0;
|
|
|
|
var type;
|
|
for (var i = 0; i < ranges.length; i++) {
|
|
var range = ranges[i], cur = range.head, curType;
|
|
var next = cm.getRange(cur, Pos(cur.line, cur.ch + 1));
|
|
if (opening && !range.empty()) {
|
|
curType = "surround";
|
|
} else if ((identical || !opening) && next == ch) {
|
|
if (identical && stringStartsAfter(cm, cur))
|
|
curType = "both";
|
|
else if (triples.indexOf(ch) >= 0 && cm.getRange(cur, Pos(cur.line, cur.ch + 3)) == ch + ch + ch)
|
|
curType = "skipThree";
|
|
else
|
|
curType = "skip";
|
|
} else if (identical && cur.ch > 1 && triples.indexOf(ch) >= 0 &&
|
|
cm.getRange(Pos(cur.line, cur.ch - 2), cur) == ch + ch) {
|
|
if (cur.ch > 2 && /\bstring/.test(cm.getTokenTypeAt(Pos(cur.line, cur.ch - 2)))) return CodeMirror.Pass;
|
|
curType = "addFour";
|
|
} else if (identical) {
|
|
var prev = cur.ch == 0 ? " " : cm.getRange(Pos(cur.line, cur.ch - 1), cur)
|
|
if (!CodeMirror.isWordChar(next) && prev != ch && !CodeMirror.isWordChar(prev)) curType = "both";
|
|
else return CodeMirror.Pass;
|
|
} else if (opening && (next.length === 0 || /\s/.test(next) || closeBefore.indexOf(next) > -1)) {
|
|
curType = "both";
|
|
} else {
|
|
return CodeMirror.Pass;
|
|
}
|
|
if (!type) type = curType;
|
|
else if (type != curType) return CodeMirror.Pass;
|
|
}
|
|
|
|
var left = pos % 2 ? pairs.charAt(pos - 1) : ch;
|
|
var right = pos % 2 ? ch : pairs.charAt(pos + 1);
|
|
cm.operation(function() {
|
|
if (type == "skip") {
|
|
cm.execCommand("goCharRight");
|
|
} else if (type == "skipThree") {
|
|
for (var i = 0; i < 3; i++)
|
|
cm.execCommand("goCharRight");
|
|
} else if (type == "surround") {
|
|
var sels = cm.getSelections();
|
|
for (var i = 0; i < sels.length; i++)
|
|
sels[i] = left + sels[i] + right;
|
|
cm.replaceSelections(sels, "around");
|
|
sels = cm.listSelections().slice();
|
|
for (var i = 0; i < sels.length; i++)
|
|
sels[i] = contractSelection(sels[i]);
|
|
cm.setSelections(sels);
|
|
} else if (type == "both") {
|
|
cm.replaceSelection(left + right, null);
|
|
cm.triggerElectric(left + right);
|
|
cm.execCommand("goCharLeft");
|
|
} else if (type == "addFour") {
|
|
cm.replaceSelection(left + left + left + left, "before");
|
|
cm.execCommand("goCharRight");
|
|
}
|
|
});
|
|
}
|
|
|
|
function charsAround(cm, pos) {
|
|
var str = cm.getRange(Pos(pos.line, pos.ch - 1),
|
|
Pos(pos.line, pos.ch + 1));
|
|
return str.length == 2 ? str : null;
|
|
}
|
|
|
|
function stringStartsAfter(cm, pos) {
|
|
var token = cm.getTokenAt(Pos(pos.line, pos.ch + 1))
|
|
return /\bstring/.test(token.type) && token.start == pos.ch &&
|
|
(pos.ch == 0 || !/\bstring/.test(cm.getTokenTypeAt(pos)))
|
|
}
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 6313:
|
|
/*!***************************************************************************!*\
|
|
!*** ./node_modules/_codemirror@5.58.2@codemirror/addon/edit/closetag.js ***!
|
|
\***************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
// Distributed under an MIT license: https://codemirror.net/LICENSE
|
|
|
|
/**
|
|
* Tag-closer extension for CodeMirror.
|
|
*
|
|
* This extension adds an "autoCloseTags" option that can be set to
|
|
* either true to get the default behavior, or an object to further
|
|
* configure its behavior.
|
|
*
|
|
* These are supported options:
|
|
*
|
|
* `whenClosing` (default true)
|
|
* Whether to autoclose when the '/' of a closing tag is typed.
|
|
* `whenOpening` (default true)
|
|
* Whether to autoclose the tag when the final '>' of an opening
|
|
* tag is typed.
|
|
* `dontCloseTags` (default is empty tags for HTML, none for XML)
|
|
* An array of tag names that should not be autoclosed.
|
|
* `indentTags` (default is block tags for HTML, none for XML)
|
|
* An array of tag names that should, when opened, cause a
|
|
* blank line to be added inside the tag, and the blank line and
|
|
* closing line to be indented.
|
|
* `emptyTags` (default is none)
|
|
* An array of XML tag names that should be autoclosed with '/>'.
|
|
*
|
|
* See demos/closetag.html for a usage example.
|
|
*/
|
|
|
|
(function(mod) {
|
|
if (true) // CommonJS
|
|
mod(__webpack_require__(/*! ../../lib/codemirror */ 89780), __webpack_require__(/*! ../fold/xml-fold */ 32855));
|
|
else {}
|
|
})(function(CodeMirror) {
|
|
CodeMirror.defineOption("autoCloseTags", false, function(cm, val, old) {
|
|
if (old != CodeMirror.Init && old)
|
|
cm.removeKeyMap("autoCloseTags");
|
|
if (!val) return;
|
|
var map = {name: "autoCloseTags"};
|
|
if (typeof val != "object" || val.whenClosing !== false)
|
|
map["'/'"] = function(cm) { return autoCloseSlash(cm); };
|
|
if (typeof val != "object" || val.whenOpening !== false)
|
|
map["'>'"] = function(cm) { return autoCloseGT(cm); };
|
|
cm.addKeyMap(map);
|
|
});
|
|
|
|
var htmlDontClose = ["area", "base", "br", "col", "command", "embed", "hr", "img", "input", "keygen", "link", "meta", "param",
|
|
"source", "track", "wbr"];
|
|
var htmlIndent = ["applet", "blockquote", "body", "button", "div", "dl", "fieldset", "form", "frameset", "h1", "h2", "h3", "h4",
|
|
"h5", "h6", "head", "html", "iframe", "layer", "legend", "object", "ol", "p", "select", "table", "ul"];
|
|
|
|
function autoCloseGT(cm) {
|
|
if (cm.getOption("disableInput")) return CodeMirror.Pass;
|
|
var ranges = cm.listSelections(), replacements = [];
|
|
var opt = cm.getOption("autoCloseTags");
|
|
for (var i = 0; i < ranges.length; i++) {
|
|
if (!ranges[i].empty()) return CodeMirror.Pass;
|
|
var pos = ranges[i].head, tok = cm.getTokenAt(pos);
|
|
var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state;
|
|
var tagInfo = inner.mode.xmlCurrentTag && inner.mode.xmlCurrentTag(state)
|
|
var tagName = tagInfo && tagInfo.name
|
|
if (!tagName) return CodeMirror.Pass
|
|
|
|
var html = inner.mode.configuration == "html";
|
|
var dontCloseTags = (typeof opt == "object" && opt.dontCloseTags) || (html && htmlDontClose);
|
|
var indentTags = (typeof opt == "object" && opt.indentTags) || (html && htmlIndent);
|
|
|
|
if (tok.end > pos.ch) tagName = tagName.slice(0, tagName.length - tok.end + pos.ch);
|
|
var lowerTagName = tagName.toLowerCase();
|
|
// Don't process the '>' at the end of an end-tag or self-closing tag
|
|
if (!tagName ||
|
|
tok.type == "string" && (tok.end != pos.ch || !/[\"\']/.test(tok.string.charAt(tok.string.length - 1)) || tok.string.length == 1) ||
|
|
tok.type == "tag" && tagInfo.close ||
|
|
tok.string.indexOf("/") == (pos.ch - tok.start - 1) || // match something like <someTagName />
|
|
dontCloseTags && indexOf(dontCloseTags, lowerTagName) > -1 ||
|
|
closingTagExists(cm, inner.mode.xmlCurrentContext && inner.mode.xmlCurrentContext(state) || [], tagName, pos, true))
|
|
return CodeMirror.Pass;
|
|
|
|
var emptyTags = typeof opt == "object" && opt.emptyTags;
|
|
if (emptyTags && indexOf(emptyTags, tagName) > -1) {
|
|
replacements[i] = { text: "/>", newPos: CodeMirror.Pos(pos.line, pos.ch + 2) };
|
|
continue;
|
|
}
|
|
|
|
var indent = indentTags && indexOf(indentTags, lowerTagName) > -1;
|
|
replacements[i] = {indent: indent,
|
|
text: ">" + (indent ? "\n\n" : "") + "</" + tagName + ">",
|
|
newPos: indent ? CodeMirror.Pos(pos.line + 1, 0) : CodeMirror.Pos(pos.line, pos.ch + 1)};
|
|
}
|
|
|
|
var dontIndentOnAutoClose = (typeof opt == "object" && opt.dontIndentOnAutoClose);
|
|
for (var i = ranges.length - 1; i >= 0; i--) {
|
|
var info = replacements[i];
|
|
cm.replaceRange(info.text, ranges[i].head, ranges[i].anchor, "+insert");
|
|
var sel = cm.listSelections().slice(0);
|
|
sel[i] = {head: info.newPos, anchor: info.newPos};
|
|
cm.setSelections(sel);
|
|
if (!dontIndentOnAutoClose && info.indent) {
|
|
cm.indentLine(info.newPos.line, null, true);
|
|
cm.indentLine(info.newPos.line + 1, null, true);
|
|
}
|
|
}
|
|
}
|
|
|
|
function autoCloseCurrent(cm, typingSlash) {
|
|
var ranges = cm.listSelections(), replacements = [];
|
|
var head = typingSlash ? "/" : "</";
|
|
var opt = cm.getOption("autoCloseTags");
|
|
var dontIndentOnAutoClose = (typeof opt == "object" && opt.dontIndentOnSlash);
|
|
for (var i = 0; i < ranges.length; i++) {
|
|
if (!ranges[i].empty()) return CodeMirror.Pass;
|
|
var pos = ranges[i].head, tok = cm.getTokenAt(pos);
|
|
var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state;
|
|
if (typingSlash && (tok.type == "string" || tok.string.charAt(0) != "<" ||
|
|
tok.start != pos.ch - 1))
|
|
return CodeMirror.Pass;
|
|
// Kludge to get around the fact that we are not in XML mode
|
|
// when completing in JS/CSS snippet in htmlmixed mode. Does not
|
|
// work for other XML embedded languages (there is no general
|
|
// way to go from a mixed mode to its current XML state).
|
|
var replacement, mixed = inner.mode.name != "xml" && cm.getMode().name == "htmlmixed"
|
|
if (mixed && inner.mode.name == "javascript") {
|
|
replacement = head + "script";
|
|
} else if (mixed && inner.mode.name == "css") {
|
|
replacement = head + "style";
|
|
} else {
|
|
var context = inner.mode.xmlCurrentContext && inner.mode.xmlCurrentContext(state)
|
|
if (!context || (context.length && closingTagExists(cm, context, context[context.length - 1], pos)))
|
|
return CodeMirror.Pass;
|
|
replacement = head + context[context.length - 1]
|
|
}
|
|
if (cm.getLine(pos.line).charAt(tok.end) != ">") replacement += ">";
|
|
replacements[i] = replacement;
|
|
}
|
|
cm.replaceSelections(replacements);
|
|
ranges = cm.listSelections();
|
|
if (!dontIndentOnAutoClose) {
|
|
for (var i = 0; i < ranges.length; i++)
|
|
if (i == ranges.length - 1 || ranges[i].head.line < ranges[i + 1].head.line)
|
|
cm.indentLine(ranges[i].head.line);
|
|
}
|
|
}
|
|
|
|
function autoCloseSlash(cm) {
|
|
if (cm.getOption("disableInput")) return CodeMirror.Pass;
|
|
return autoCloseCurrent(cm, true);
|
|
}
|
|
|
|
CodeMirror.commands.closeTag = function(cm) { return autoCloseCurrent(cm); };
|
|
|
|
function indexOf(collection, elt) {
|
|
if (collection.indexOf) return collection.indexOf(elt);
|
|
for (var i = 0, e = collection.length; i < e; ++i)
|
|
if (collection[i] == elt) return i;
|
|
return -1;
|
|
}
|
|
|
|
// If xml-fold is loaded, we use its functionality to try and verify
|
|
// whether a given tag is actually unclosed.
|
|
function closingTagExists(cm, context, tagName, pos, newTag) {
|
|
if (!CodeMirror.scanForClosingTag) return false;
|
|
var end = Math.min(cm.lastLine() + 1, pos.line + 500);
|
|
var nextClose = CodeMirror.scanForClosingTag(cm, pos, null, end);
|
|
if (!nextClose || nextClose.tag != tagName) return false;
|
|
// If the immediate wrapping context contains onCx instances of
|
|
// the same tag, a closing tag only exists if there are at least
|
|
// that many closing tags of that type following.
|
|
var onCx = newTag ? 1 : 0
|
|
for (var i = context.length - 1; i >= 0; i--) {
|
|
if (context[i] == tagName) ++onCx
|
|
else break
|
|
}
|
|
pos = nextClose.to;
|
|
for (var i = 1; i < onCx; i++) {
|
|
var next = CodeMirror.scanForClosingTag(cm, pos, null, end);
|
|
if (!next || next.tag != tagName) return false;
|
|
pos = next.to;
|
|
}
|
|
return true;
|
|
}
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 32855:
|
|
/*!***************************************************************************!*\
|
|
!*** ./node_modules/_codemirror@5.58.2@codemirror/addon/fold/xml-fold.js ***!
|
|
\***************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
// Distributed under an MIT license: https://codemirror.net/LICENSE
|
|
|
|
(function(mod) {
|
|
if (true) // CommonJS
|
|
mod(__webpack_require__(/*! ../../lib/codemirror */ 89780));
|
|
else {}
|
|
})(function(CodeMirror) {
|
|
"use strict";
|
|
|
|
var Pos = CodeMirror.Pos;
|
|
function cmp(a, b) { return a.line - b.line || a.ch - b.ch; }
|
|
|
|
var nameStartChar = "A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
|
|
var nameChar = nameStartChar + "\-\:\.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
|
|
var xmlTagStart = new RegExp("<(/?)([" + nameStartChar + "][" + nameChar + "]*)", "g");
|
|
|
|
function Iter(cm, line, ch, range) {
|
|
this.line = line; this.ch = ch;
|
|
this.cm = cm; this.text = cm.getLine(line);
|
|
this.min = range ? Math.max(range.from, cm.firstLine()) : cm.firstLine();
|
|
this.max = range ? Math.min(range.to - 1, cm.lastLine()) : cm.lastLine();
|
|
}
|
|
|
|
function tagAt(iter, ch) {
|
|
var type = iter.cm.getTokenTypeAt(Pos(iter.line, ch));
|
|
return type && /\btag\b/.test(type);
|
|
}
|
|
|
|
function nextLine(iter) {
|
|
if (iter.line >= iter.max) return;
|
|
iter.ch = 0;
|
|
iter.text = iter.cm.getLine(++iter.line);
|
|
return true;
|
|
}
|
|
function prevLine(iter) {
|
|
if (iter.line <= iter.min) return;
|
|
iter.text = iter.cm.getLine(--iter.line);
|
|
iter.ch = iter.text.length;
|
|
return true;
|
|
}
|
|
|
|
function toTagEnd(iter) {
|
|
for (;;) {
|
|
var gt = iter.text.indexOf(">", iter.ch);
|
|
if (gt == -1) { if (nextLine(iter)) continue; else return; }
|
|
if (!tagAt(iter, gt + 1)) { iter.ch = gt + 1; continue; }
|
|
var lastSlash = iter.text.lastIndexOf("/", gt);
|
|
var selfClose = lastSlash > -1 && !/\S/.test(iter.text.slice(lastSlash + 1, gt));
|
|
iter.ch = gt + 1;
|
|
return selfClose ? "selfClose" : "regular";
|
|
}
|
|
}
|
|
function toTagStart(iter) {
|
|
for (;;) {
|
|
var lt = iter.ch ? iter.text.lastIndexOf("<", iter.ch - 1) : -1;
|
|
if (lt == -1) { if (prevLine(iter)) continue; else return; }
|
|
if (!tagAt(iter, lt + 1)) { iter.ch = lt; continue; }
|
|
xmlTagStart.lastIndex = lt;
|
|
iter.ch = lt;
|
|
var match = xmlTagStart.exec(iter.text);
|
|
if (match && match.index == lt) return match;
|
|
}
|
|
}
|
|
|
|
function toNextTag(iter) {
|
|
for (;;) {
|
|
xmlTagStart.lastIndex = iter.ch;
|
|
var found = xmlTagStart.exec(iter.text);
|
|
if (!found) { if (nextLine(iter)) continue; else return; }
|
|
if (!tagAt(iter, found.index + 1)) { iter.ch = found.index + 1; continue; }
|
|
iter.ch = found.index + found[0].length;
|
|
return found;
|
|
}
|
|
}
|
|
function toPrevTag(iter) {
|
|
for (;;) {
|
|
var gt = iter.ch ? iter.text.lastIndexOf(">", iter.ch - 1) : -1;
|
|
if (gt == -1) { if (prevLine(iter)) continue; else return; }
|
|
if (!tagAt(iter, gt + 1)) { iter.ch = gt; continue; }
|
|
var lastSlash = iter.text.lastIndexOf("/", gt);
|
|
var selfClose = lastSlash > -1 && !/\S/.test(iter.text.slice(lastSlash + 1, gt));
|
|
iter.ch = gt + 1;
|
|
return selfClose ? "selfClose" : "regular";
|
|
}
|
|
}
|
|
|
|
function findMatchingClose(iter, tag) {
|
|
var stack = [];
|
|
for (;;) {
|
|
var next = toNextTag(iter), end, startLine = iter.line, startCh = iter.ch - (next ? next[0].length : 0);
|
|
if (!next || !(end = toTagEnd(iter))) return;
|
|
if (end == "selfClose") continue;
|
|
if (next[1]) { // closing tag
|
|
for (var i = stack.length - 1; i >= 0; --i) if (stack[i] == next[2]) {
|
|
stack.length = i;
|
|
break;
|
|
}
|
|
if (i < 0 && (!tag || tag == next[2])) return {
|
|
tag: next[2],
|
|
from: Pos(startLine, startCh),
|
|
to: Pos(iter.line, iter.ch)
|
|
};
|
|
} else { // opening tag
|
|
stack.push(next[2]);
|
|
}
|
|
}
|
|
}
|
|
function findMatchingOpen(iter, tag) {
|
|
var stack = [];
|
|
for (;;) {
|
|
var prev = toPrevTag(iter);
|
|
if (!prev) return;
|
|
if (prev == "selfClose") { toTagStart(iter); continue; }
|
|
var endLine = iter.line, endCh = iter.ch;
|
|
var start = toTagStart(iter);
|
|
if (!start) return;
|
|
if (start[1]) { // closing tag
|
|
stack.push(start[2]);
|
|
} else { // opening tag
|
|
for (var i = stack.length - 1; i >= 0; --i) if (stack[i] == start[2]) {
|
|
stack.length = i;
|
|
break;
|
|
}
|
|
if (i < 0 && (!tag || tag == start[2])) return {
|
|
tag: start[2],
|
|
from: Pos(iter.line, iter.ch),
|
|
to: Pos(endLine, endCh)
|
|
};
|
|
}
|
|
}
|
|
}
|
|
|
|
CodeMirror.registerHelper("fold", "xml", function(cm, start) {
|
|
var iter = new Iter(cm, start.line, 0);
|
|
for (;;) {
|
|
var openTag = toNextTag(iter)
|
|
if (!openTag || iter.line != start.line) return
|
|
var end = toTagEnd(iter)
|
|
if (!end) return
|
|
if (!openTag[1] && end != "selfClose") {
|
|
var startPos = Pos(iter.line, iter.ch);
|
|
var endPos = findMatchingClose(iter, openTag[2]);
|
|
return endPos && cmp(endPos.from, startPos) > 0 ? {from: startPos, to: endPos.from} : null
|
|
}
|
|
}
|
|
});
|
|
CodeMirror.findMatchingTag = function(cm, pos, range) {
|
|
var iter = new Iter(cm, pos.line, pos.ch, range);
|
|
if (iter.text.indexOf(">") == -1 && iter.text.indexOf("<") == -1) return;
|
|
var end = toTagEnd(iter), to = end && Pos(iter.line, iter.ch);
|
|
var start = end && toTagStart(iter);
|
|
if (!end || !start || cmp(iter, pos) > 0) return;
|
|
var here = {from: Pos(iter.line, iter.ch), to: to, tag: start[2]};
|
|
if (end == "selfClose") return {open: here, close: null, at: "open"};
|
|
|
|
if (start[1]) { // closing tag
|
|
return {open: findMatchingOpen(iter, start[2]), close: here, at: "close"};
|
|
} else { // opening tag
|
|
iter = new Iter(cm, to.line, to.ch, range);
|
|
return {open: here, close: findMatchingClose(iter, start[2]), at: "open"};
|
|
}
|
|
};
|
|
|
|
CodeMirror.findEnclosingTag = function(cm, pos, range, tag) {
|
|
var iter = new Iter(cm, pos.line, pos.ch, range);
|
|
for (;;) {
|
|
var open = findMatchingOpen(iter, tag);
|
|
if (!open) break;
|
|
var forward = new Iter(cm, pos.line, pos.ch, range);
|
|
var close = findMatchingClose(forward, open.tag);
|
|
if (close) return {open: open, close: close};
|
|
}
|
|
};
|
|
|
|
// Used by addon/edit/closetag.js
|
|
CodeMirror.scanForClosingTag = function(cm, pos, name, end) {
|
|
var iter = new Iter(cm, pos.line, pos.ch, end ? {from: 0, to: end} : null);
|
|
return findMatchingClose(iter, name);
|
|
};
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 25419:
|
|
/*!******************************************************************************!*\
|
|
!*** ./node_modules/_codemirror@5.58.2@codemirror/mode/markdown/markdown.js ***!
|
|
\******************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
// Distributed under an MIT license: https://codemirror.net/LICENSE
|
|
|
|
(function(mod) {
|
|
if (true) // CommonJS
|
|
mod(__webpack_require__(/*! ../../lib/codemirror */ 89780), __webpack_require__(/*! ../xml/xml */ 15525), __webpack_require__(/*! ../meta */ 98101));
|
|
else {}
|
|
})(function(CodeMirror) {
|
|
"use strict";
|
|
|
|
CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
|
|
|
var htmlMode = CodeMirror.getMode(cmCfg, "text/html");
|
|
var htmlModeMissing = htmlMode.name == "null"
|
|
|
|
function getMode(name) {
|
|
if (CodeMirror.findModeByName) {
|
|
var found = CodeMirror.findModeByName(name);
|
|
if (found) name = found.mime || found.mimes[0];
|
|
}
|
|
var mode = CodeMirror.getMode(cmCfg, name);
|
|
return mode.name == "null" ? null : mode;
|
|
}
|
|
|
|
// Should characters that affect highlighting be highlighted separate?
|
|
// Does not include characters that will be output (such as `1.` and `-` for lists)
|
|
if (modeCfg.highlightFormatting === undefined)
|
|
modeCfg.highlightFormatting = false;
|
|
|
|
// Maximum number of nested blockquotes. Set to 0 for infinite nesting.
|
|
// Excess `>` will emit `error` token.
|
|
if (modeCfg.maxBlockquoteDepth === undefined)
|
|
modeCfg.maxBlockquoteDepth = 0;
|
|
|
|
// Turn on task lists? ("- [ ] " and "- [x] ")
|
|
if (modeCfg.taskLists === undefined) modeCfg.taskLists = false;
|
|
|
|
// Turn on strikethrough syntax
|
|
if (modeCfg.strikethrough === undefined)
|
|
modeCfg.strikethrough = false;
|
|
|
|
if (modeCfg.emoji === undefined)
|
|
modeCfg.emoji = false;
|
|
|
|
if (modeCfg.fencedCodeBlockHighlighting === undefined)
|
|
modeCfg.fencedCodeBlockHighlighting = true;
|
|
|
|
if (modeCfg.fencedCodeBlockDefaultMode === undefined)
|
|
modeCfg.fencedCodeBlockDefaultMode = 'text/plain';
|
|
|
|
if (modeCfg.xml === undefined)
|
|
modeCfg.xml = true;
|
|
|
|
// Allow token types to be overridden by user-provided token types.
|
|
if (modeCfg.tokenTypeOverrides === undefined)
|
|
modeCfg.tokenTypeOverrides = {};
|
|
|
|
var tokenTypes = {
|
|
header: "header",
|
|
code: "comment",
|
|
quote: "quote",
|
|
list1: "variable-2",
|
|
list2: "variable-3",
|
|
list3: "keyword",
|
|
hr: "hr",
|
|
image: "image",
|
|
imageAltText: "image-alt-text",
|
|
imageMarker: "image-marker",
|
|
formatting: "formatting",
|
|
linkInline: "link",
|
|
linkEmail: "link",
|
|
linkText: "link",
|
|
linkHref: "string",
|
|
em: "em",
|
|
strong: "strong",
|
|
strikethrough: "strikethrough",
|
|
emoji: "builtin"
|
|
};
|
|
|
|
for (var tokenType in tokenTypes) {
|
|
if (tokenTypes.hasOwnProperty(tokenType) && modeCfg.tokenTypeOverrides[tokenType]) {
|
|
tokenTypes[tokenType] = modeCfg.tokenTypeOverrides[tokenType];
|
|
}
|
|
}
|
|
|
|
var hrRE = /^([*\-_])(?:\s*\1){2,}\s*$/
|
|
, listRE = /^(?:[*\-+]|^[0-9]+([.)]))\s+/
|
|
, taskListRE = /^\[(x| )\](?=\s)/i // Must follow listRE
|
|
, atxHeaderRE = modeCfg.allowAtxHeaderWithoutSpace ? /^(#+)/ : /^(#+)(?: |$)/
|
|
, setextHeaderRE = /^ {0,3}(?:\={1,}|-{2,})\s*$/
|
|
, textRE = /^[^#!\[\]*_\\<>` "'(~:]+/
|
|
, fencedCodeRE = /^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/
|
|
, linkDefRE = /^\s*\[[^\]]+?\]:.*$/ // naive link-definition
|
|
, punctuation = /[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/
|
|
, expandedTab = " " // CommonMark specifies tab as 4 spaces
|
|
|
|
function switchInline(stream, state, f) {
|
|
state.f = state.inline = f;
|
|
return f(stream, state);
|
|
}
|
|
|
|
function switchBlock(stream, state, f) {
|
|
state.f = state.block = f;
|
|
return f(stream, state);
|
|
}
|
|
|
|
function lineIsEmpty(line) {
|
|
return !line || !/\S/.test(line.string)
|
|
}
|
|
|
|
// Blocks
|
|
|
|
function blankLine(state) {
|
|
// Reset linkTitle state
|
|
state.linkTitle = false;
|
|
state.linkHref = false;
|
|
state.linkText = false;
|
|
// Reset EM state
|
|
state.em = false;
|
|
// Reset STRONG state
|
|
state.strong = false;
|
|
// Reset strikethrough state
|
|
state.strikethrough = false;
|
|
// Reset state.quote
|
|
state.quote = 0;
|
|
// Reset state.indentedCode
|
|
state.indentedCode = false;
|
|
if (state.f == htmlBlock) {
|
|
var exit = htmlModeMissing
|
|
if (!exit) {
|
|
var inner = CodeMirror.innerMode(htmlMode, state.htmlState)
|
|
exit = inner.mode.name == "xml" && inner.state.tagStart === null &&
|
|
(!inner.state.context && inner.state.tokenize.isInText)
|
|
}
|
|
if (exit) {
|
|
state.f = inlineNormal;
|
|
state.block = blockNormal;
|
|
state.htmlState = null;
|
|
}
|
|
}
|
|
// Reset state.trailingSpace
|
|
state.trailingSpace = 0;
|
|
state.trailingSpaceNewLine = false;
|
|
// Mark this line as blank
|
|
state.prevLine = state.thisLine
|
|
state.thisLine = {stream: null}
|
|
return null;
|
|
}
|
|
|
|
function blockNormal(stream, state) {
|
|
var firstTokenOnLine = stream.column() === state.indentation;
|
|
var prevLineLineIsEmpty = lineIsEmpty(state.prevLine.stream);
|
|
var prevLineIsIndentedCode = state.indentedCode;
|
|
var prevLineIsHr = state.prevLine.hr;
|
|
var prevLineIsList = state.list !== false;
|
|
var maxNonCodeIndentation = (state.listStack[state.listStack.length - 1] || 0) + 3;
|
|
|
|
state.indentedCode = false;
|
|
|
|
var lineIndentation = state.indentation;
|
|
// compute once per line (on first token)
|
|
if (state.indentationDiff === null) {
|
|
state.indentationDiff = state.indentation;
|
|
if (prevLineIsList) {
|
|
state.list = null;
|
|
// While this list item's marker's indentation is less than the deepest
|
|
// list item's content's indentation,pop the deepest list item
|
|
// indentation off the stack, and update block indentation state
|
|
while (lineIndentation < state.listStack[state.listStack.length - 1]) {
|
|
state.listStack.pop();
|
|
if (state.listStack.length) {
|
|
state.indentation = state.listStack[state.listStack.length - 1];
|
|
// less than the first list's indent -> the line is no longer a list
|
|
} else {
|
|
state.list = false;
|
|
}
|
|
}
|
|
if (state.list !== false) {
|
|
state.indentationDiff = lineIndentation - state.listStack[state.listStack.length - 1]
|
|
}
|
|
}
|
|
}
|
|
|
|
// not comprehensive (currently only for setext detection purposes)
|
|
var allowsInlineContinuation = (
|
|
!prevLineLineIsEmpty && !prevLineIsHr && !state.prevLine.header &&
|
|
(!prevLineIsList || !prevLineIsIndentedCode) &&
|
|
!state.prevLine.fencedCodeEnd
|
|
);
|
|
|
|
var isHr = (state.list === false || prevLineIsHr || prevLineLineIsEmpty) &&
|
|
state.indentation <= maxNonCodeIndentation && stream.match(hrRE);
|
|
|
|
var match = null;
|
|
if (state.indentationDiff >= 4 && (prevLineIsIndentedCode || state.prevLine.fencedCodeEnd ||
|
|
state.prevLine.header || prevLineLineIsEmpty)) {
|
|
stream.skipToEnd();
|
|
state.indentedCode = true;
|
|
return tokenTypes.code;
|
|
} else if (stream.eatSpace()) {
|
|
return null;
|
|
} else if (firstTokenOnLine && state.indentation <= maxNonCodeIndentation && (match = stream.match(atxHeaderRE)) && match[1].length <= 6) {
|
|
state.quote = 0;
|
|
state.header = match[1].length;
|
|
state.thisLine.header = true;
|
|
if (modeCfg.highlightFormatting) state.formatting = "header";
|
|
state.f = state.inline;
|
|
return getType(state);
|
|
} else if (state.indentation <= maxNonCodeIndentation && stream.eat('>')) {
|
|
state.quote = firstTokenOnLine ? 1 : state.quote + 1;
|
|
if (modeCfg.highlightFormatting) state.formatting = "quote";
|
|
stream.eatSpace();
|
|
return getType(state);
|
|
} else if (!isHr && !state.setext && firstTokenOnLine && state.indentation <= maxNonCodeIndentation && (match = stream.match(listRE))) {
|
|
var listType = match[1] ? "ol" : "ul";
|
|
|
|
state.indentation = lineIndentation + stream.current().length;
|
|
state.list = true;
|
|
state.quote = 0;
|
|
|
|
// Add this list item's content's indentation to the stack
|
|
state.listStack.push(state.indentation);
|
|
// Reset inline styles which shouldn't propagate aross list items
|
|
state.em = false;
|
|
state.strong = false;
|
|
state.code = false;
|
|
state.strikethrough = false;
|
|
|
|
if (modeCfg.taskLists && stream.match(taskListRE, false)) {
|
|
state.taskList = true;
|
|
}
|
|
state.f = state.inline;
|
|
if (modeCfg.highlightFormatting) state.formatting = ["list", "list-" + listType];
|
|
return getType(state);
|
|
} else if (firstTokenOnLine && state.indentation <= maxNonCodeIndentation && (match = stream.match(fencedCodeRE, true))) {
|
|
state.quote = 0;
|
|
state.fencedEndRE = new RegExp(match[1] + "+ *$");
|
|
// try switching mode
|
|
state.localMode = modeCfg.fencedCodeBlockHighlighting && getMode(match[2] || modeCfg.fencedCodeBlockDefaultMode );
|
|
if (state.localMode) state.localState = CodeMirror.startState(state.localMode);
|
|
state.f = state.block = local;
|
|
if (modeCfg.highlightFormatting) state.formatting = "code-block";
|
|
state.code = -1
|
|
return getType(state);
|
|
// SETEXT has lowest block-scope precedence after HR, so check it after
|
|
// the others (code, blockquote, list...)
|
|
} else if (
|
|
// if setext set, indicates line after ---/===
|
|
state.setext || (
|
|
// line before ---/===
|
|
(!allowsInlineContinuation || !prevLineIsList) && !state.quote && state.list === false &&
|
|
!state.code && !isHr && !linkDefRE.test(stream.string) &&
|
|
(match = stream.lookAhead(1)) && (match = match.match(setextHeaderRE))
|
|
)
|
|
) {
|
|
if ( !state.setext ) {
|
|
state.header = match[0].charAt(0) == '=' ? 1 : 2;
|
|
state.setext = state.header;
|
|
} else {
|
|
state.header = state.setext;
|
|
// has no effect on type so we can reset it now
|
|
state.setext = 0;
|
|
stream.skipToEnd();
|
|
if (modeCfg.highlightFormatting) state.formatting = "header";
|
|
}
|
|
state.thisLine.header = true;
|
|
state.f = state.inline;
|
|
return getType(state);
|
|
} else if (isHr) {
|
|
stream.skipToEnd();
|
|
state.hr = true;
|
|
state.thisLine.hr = true;
|
|
return tokenTypes.hr;
|
|
} else if (stream.peek() === '[') {
|
|
return switchInline(stream, state, footnoteLink);
|
|
}
|
|
|
|
return switchInline(stream, state, state.inline);
|
|
}
|
|
|
|
function htmlBlock(stream, state) {
|
|
var style = htmlMode.token(stream, state.htmlState);
|
|
if (!htmlModeMissing) {
|
|
var inner = CodeMirror.innerMode(htmlMode, state.htmlState)
|
|
if ((inner.mode.name == "xml" && inner.state.tagStart === null &&
|
|
(!inner.state.context && inner.state.tokenize.isInText)) ||
|
|
(state.md_inside && stream.current().indexOf(">") > -1)) {
|
|
state.f = inlineNormal;
|
|
state.block = blockNormal;
|
|
state.htmlState = null;
|
|
}
|
|
}
|
|
return style;
|
|
}
|
|
|
|
function local(stream, state) {
|
|
var currListInd = state.listStack[state.listStack.length - 1] || 0;
|
|
var hasExitedList = state.indentation < currListInd;
|
|
var maxFencedEndInd = currListInd + 3;
|
|
if (state.fencedEndRE && state.indentation <= maxFencedEndInd && (hasExitedList || stream.match(state.fencedEndRE))) {
|
|
if (modeCfg.highlightFormatting) state.formatting = "code-block";
|
|
var returnType;
|
|
if (!hasExitedList) returnType = getType(state)
|
|
state.localMode = state.localState = null;
|
|
state.block = blockNormal;
|
|
state.f = inlineNormal;
|
|
state.fencedEndRE = null;
|
|
state.code = 0
|
|
state.thisLine.fencedCodeEnd = true;
|
|
if (hasExitedList) return switchBlock(stream, state, state.block);
|
|
return returnType;
|
|
} else if (state.localMode) {
|
|
return state.localMode.token(stream, state.localState);
|
|
} else {
|
|
stream.skipToEnd();
|
|
return tokenTypes.code;
|
|
}
|
|
}
|
|
|
|
// Inline
|
|
function getType(state) {
|
|
var styles = [];
|
|
|
|
if (state.formatting) {
|
|
styles.push(tokenTypes.formatting);
|
|
|
|
if (typeof state.formatting === "string") state.formatting = [state.formatting];
|
|
|
|
for (var i = 0; i < state.formatting.length; i++) {
|
|
styles.push(tokenTypes.formatting + "-" + state.formatting[i]);
|
|
|
|
if (state.formatting[i] === "header") {
|
|
styles.push(tokenTypes.formatting + "-" + state.formatting[i] + "-" + state.header);
|
|
}
|
|
|
|
// Add `formatting-quote` and `formatting-quote-#` for blockquotes
|
|
// Add `error` instead if the maximum blockquote nesting depth is passed
|
|
if (state.formatting[i] === "quote") {
|
|
if (!modeCfg.maxBlockquoteDepth || modeCfg.maxBlockquoteDepth >= state.quote) {
|
|
styles.push(tokenTypes.formatting + "-" + state.formatting[i] + "-" + state.quote);
|
|
} else {
|
|
styles.push("error");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if (state.taskOpen) {
|
|
styles.push("meta");
|
|
return styles.length ? styles.join(' ') : null;
|
|
}
|
|
if (state.taskClosed) {
|
|
styles.push("property");
|
|
return styles.length ? styles.join(' ') : null;
|
|
}
|
|
|
|
if (state.linkHref) {
|
|
styles.push(tokenTypes.linkHref, "url");
|
|
} else { // Only apply inline styles to non-url text
|
|
if (state.strong) { styles.push(tokenTypes.strong); }
|
|
if (state.em) { styles.push(tokenTypes.em); }
|
|
if (state.strikethrough) { styles.push(tokenTypes.strikethrough); }
|
|
if (state.emoji) { styles.push(tokenTypes.emoji); }
|
|
if (state.linkText) { styles.push(tokenTypes.linkText); }
|
|
if (state.code) { styles.push(tokenTypes.code); }
|
|
if (state.image) { styles.push(tokenTypes.image); }
|
|
if (state.imageAltText) { styles.push(tokenTypes.imageAltText, "link"); }
|
|
if (state.imageMarker) { styles.push(tokenTypes.imageMarker); }
|
|
}
|
|
|
|
if (state.header) { styles.push(tokenTypes.header, tokenTypes.header + "-" + state.header); }
|
|
|
|
if (state.quote) {
|
|
styles.push(tokenTypes.quote);
|
|
|
|
// Add `quote-#` where the maximum for `#` is modeCfg.maxBlockquoteDepth
|
|
if (!modeCfg.maxBlockquoteDepth || modeCfg.maxBlockquoteDepth >= state.quote) {
|
|
styles.push(tokenTypes.quote + "-" + state.quote);
|
|
} else {
|
|
styles.push(tokenTypes.quote + "-" + modeCfg.maxBlockquoteDepth);
|
|
}
|
|
}
|
|
|
|
if (state.list !== false) {
|
|
var listMod = (state.listStack.length - 1) % 3;
|
|
if (!listMod) {
|
|
styles.push(tokenTypes.list1);
|
|
} else if (listMod === 1) {
|
|
styles.push(tokenTypes.list2);
|
|
} else {
|
|
styles.push(tokenTypes.list3);
|
|
}
|
|
}
|
|
|
|
if (state.trailingSpaceNewLine) {
|
|
styles.push("trailing-space-new-line");
|
|
} else if (state.trailingSpace) {
|
|
styles.push("trailing-space-" + (state.trailingSpace % 2 ? "a" : "b"));
|
|
}
|
|
|
|
return styles.length ? styles.join(' ') : null;
|
|
}
|
|
|
|
function handleText(stream, state) {
|
|
if (stream.match(textRE, true)) {
|
|
return getType(state);
|
|
}
|
|
return undefined;
|
|
}
|
|
|
|
function inlineNormal(stream, state) {
|
|
var style = state.text(stream, state);
|
|
if (typeof style !== 'undefined')
|
|
return style;
|
|
|
|
if (state.list) { // List marker (*, +, -, 1., etc)
|
|
state.list = null;
|
|
return getType(state);
|
|
}
|
|
|
|
if (state.taskList) {
|
|
var taskOpen = stream.match(taskListRE, true)[1] === " ";
|
|
if (taskOpen) state.taskOpen = true;
|
|
else state.taskClosed = true;
|
|
if (modeCfg.highlightFormatting) state.formatting = "task";
|
|
state.taskList = false;
|
|
return getType(state);
|
|
}
|
|
|
|
state.taskOpen = false;
|
|
state.taskClosed = false;
|
|
|
|
if (state.header && stream.match(/^#+$/, true)) {
|
|
if (modeCfg.highlightFormatting) state.formatting = "header";
|
|
return getType(state);
|
|
}
|
|
|
|
var ch = stream.next();
|
|
|
|
// Matches link titles present on next line
|
|
if (state.linkTitle) {
|
|
state.linkTitle = false;
|
|
var matchCh = ch;
|
|
if (ch === '(') {
|
|
matchCh = ')';
|
|
}
|
|
matchCh = (matchCh+'').replace(/([.?*+^\[\]\\(){}|-])/g, "\\$1");
|
|
var regex = '^\\s*(?:[^' + matchCh + '\\\\]+|\\\\\\\\|\\\\.)' + matchCh;
|
|
if (stream.match(new RegExp(regex), true)) {
|
|
return tokenTypes.linkHref;
|
|
}
|
|
}
|
|
|
|
// If this block is changed, it may need to be updated in GFM mode
|
|
if (ch === '`') {
|
|
var previousFormatting = state.formatting;
|
|
if (modeCfg.highlightFormatting) state.formatting = "code";
|
|
stream.eatWhile('`');
|
|
var count = stream.current().length
|
|
if (state.code == 0 && (!state.quote || count == 1)) {
|
|
state.code = count
|
|
return getType(state)
|
|
} else if (count == state.code) { // Must be exact
|
|
var t = getType(state)
|
|
state.code = 0
|
|
return t
|
|
} else {
|
|
state.formatting = previousFormatting
|
|
return getType(state)
|
|
}
|
|
} else if (state.code) {
|
|
return getType(state);
|
|
}
|
|
|
|
if (ch === '\\') {
|
|
stream.next();
|
|
if (modeCfg.highlightFormatting) {
|
|
var type = getType(state);
|
|
var formattingEscape = tokenTypes.formatting + "-escape";
|
|
return type ? type + " " + formattingEscape : formattingEscape;
|
|
}
|
|
}
|
|
|
|
if (ch === '!' && stream.match(/\[[^\]]*\] ?(?:\(|\[)/, false)) {
|
|
state.imageMarker = true;
|
|
state.image = true;
|
|
if (modeCfg.highlightFormatting) state.formatting = "image";
|
|
return getType(state);
|
|
}
|
|
|
|
if (ch === '[' && state.imageMarker && stream.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/, false)) {
|
|
state.imageMarker = false;
|
|
state.imageAltText = true
|
|
if (modeCfg.highlightFormatting) state.formatting = "image";
|
|
return getType(state);
|
|
}
|
|
|
|
if (ch === ']' && state.imageAltText) {
|
|
if (modeCfg.highlightFormatting) state.formatting = "image";
|
|
var type = getType(state);
|
|
state.imageAltText = false;
|
|
state.image = false;
|
|
state.inline = state.f = linkHref;
|
|
return type;
|
|
}
|
|
|
|
if (ch === '[' && !state.image) {
|
|
if (state.linkText && stream.match(/^.*?\]/)) return getType(state)
|
|
state.linkText = true;
|
|
if (modeCfg.highlightFormatting) state.formatting = "link";
|
|
return getType(state);
|
|
}
|
|
|
|
if (ch === ']' && state.linkText) {
|
|
if (modeCfg.highlightFormatting) state.formatting = "link";
|
|
var type = getType(state);
|
|
state.linkText = false;
|
|
state.inline = state.f = stream.match(/\(.*?\)| ?\[.*?\]/, false) ? linkHref : inlineNormal
|
|
return type;
|
|
}
|
|
|
|
if (ch === '<' && stream.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/, false)) {
|
|
state.f = state.inline = linkInline;
|
|
if (modeCfg.highlightFormatting) state.formatting = "link";
|
|
var type = getType(state);
|
|
if (type){
|
|
type += " ";
|
|
} else {
|
|
type = "";
|
|
}
|
|
return type + tokenTypes.linkInline;
|
|
}
|
|
|
|
if (ch === '<' && stream.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/, false)) {
|
|
state.f = state.inline = linkInline;
|
|
if (modeCfg.highlightFormatting) state.formatting = "link";
|
|
var type = getType(state);
|
|
if (type){
|
|
type += " ";
|
|
} else {
|
|
type = "";
|
|
}
|
|
return type + tokenTypes.linkEmail;
|
|
}
|
|
|
|
if (modeCfg.xml && ch === '<' && stream.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i, false)) {
|
|
var end = stream.string.indexOf(">", stream.pos);
|
|
if (end != -1) {
|
|
var atts = stream.string.substring(stream.start, end);
|
|
if (/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(atts)) state.md_inside = true;
|
|
}
|
|
stream.backUp(1);
|
|
state.htmlState = CodeMirror.startState(htmlMode);
|
|
return switchBlock(stream, state, htmlBlock);
|
|
}
|
|
|
|
if (modeCfg.xml && ch === '<' && stream.match(/^\/\w*?>/)) {
|
|
state.md_inside = false;
|
|
return "tag";
|
|
} else if (ch === "*" || ch === "_") {
|
|
var len = 1, before = stream.pos == 1 ? " " : stream.string.charAt(stream.pos - 2)
|
|
while (len < 3 && stream.eat(ch)) len++
|
|
var after = stream.peek() || " "
|
|
// See http://spec.commonmark.org/0.27/#emphasis-and-strong-emphasis
|
|
var leftFlanking = !/\s/.test(after) && (!punctuation.test(after) || /\s/.test(before) || punctuation.test(before))
|
|
var rightFlanking = !/\s/.test(before) && (!punctuation.test(before) || /\s/.test(after) || punctuation.test(after))
|
|
var setEm = null, setStrong = null
|
|
if (len % 2) { // Em
|
|
if (!state.em && leftFlanking && (ch === "*" || !rightFlanking || punctuation.test(before)))
|
|
setEm = true
|
|
else if (state.em == ch && rightFlanking && (ch === "*" || !leftFlanking || punctuation.test(after)))
|
|
setEm = false
|
|
}
|
|
if (len > 1) { // Strong
|
|
if (!state.strong && leftFlanking && (ch === "*" || !rightFlanking || punctuation.test(before)))
|
|
setStrong = true
|
|
else if (state.strong == ch && rightFlanking && (ch === "*" || !leftFlanking || punctuation.test(after)))
|
|
setStrong = false
|
|
}
|
|
if (setStrong != null || setEm != null) {
|
|
if (modeCfg.highlightFormatting) state.formatting = setEm == null ? "strong" : setStrong == null ? "em" : "strong em"
|
|
if (setEm === true) state.em = ch
|
|
if (setStrong === true) state.strong = ch
|
|
var t = getType(state)
|
|
if (setEm === false) state.em = false
|
|
if (setStrong === false) state.strong = false
|
|
return t
|
|
}
|
|
} else if (ch === ' ') {
|
|
if (stream.eat('*') || stream.eat('_')) { // Probably surrounded by spaces
|
|
if (stream.peek() === ' ') { // Surrounded by spaces, ignore
|
|
return getType(state);
|
|
} else { // Not surrounded by spaces, back up pointer
|
|
stream.backUp(1);
|
|
}
|
|
}
|
|
}
|
|
|
|
if (modeCfg.strikethrough) {
|
|
if (ch === '~' && stream.eatWhile(ch)) {
|
|
if (state.strikethrough) {// Remove strikethrough
|
|
if (modeCfg.highlightFormatting) state.formatting = "strikethrough";
|
|
var t = getType(state);
|
|
state.strikethrough = false;
|
|
return t;
|
|
} else if (stream.match(/^[^\s]/, false)) {// Add strikethrough
|
|
state.strikethrough = true;
|
|
if (modeCfg.highlightFormatting) state.formatting = "strikethrough";
|
|
return getType(state);
|
|
}
|
|
} else if (ch === ' ') {
|
|
if (stream.match(/^~~/, true)) { // Probably surrounded by space
|
|
if (stream.peek() === ' ') { // Surrounded by spaces, ignore
|
|
return getType(state);
|
|
} else { // Not surrounded by spaces, back up pointer
|
|
stream.backUp(2);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if (modeCfg.emoji && ch === ":" && stream.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)) {
|
|
state.emoji = true;
|
|
if (modeCfg.highlightFormatting) state.formatting = "emoji";
|
|
var retType = getType(state);
|
|
state.emoji = false;
|
|
return retType;
|
|
}
|
|
|
|
if (ch === ' ') {
|
|
if (stream.match(/^ +$/, false)) {
|
|
state.trailingSpace++;
|
|
} else if (state.trailingSpace) {
|
|
state.trailingSpaceNewLine = true;
|
|
}
|
|
}
|
|
|
|
return getType(state);
|
|
}
|
|
|
|
function linkInline(stream, state) {
|
|
var ch = stream.next();
|
|
|
|
if (ch === ">") {
|
|
state.f = state.inline = inlineNormal;
|
|
if (modeCfg.highlightFormatting) state.formatting = "link";
|
|
var type = getType(state);
|
|
if (type){
|
|
type += " ";
|
|
} else {
|
|
type = "";
|
|
}
|
|
return type + tokenTypes.linkInline;
|
|
}
|
|
|
|
stream.match(/^[^>]+/, true);
|
|
|
|
return tokenTypes.linkInline;
|
|
}
|
|
|
|
function linkHref(stream, state) {
|
|
// Check if space, and return NULL if so (to avoid marking the space)
|
|
if(stream.eatSpace()){
|
|
return null;
|
|
}
|
|
var ch = stream.next();
|
|
if (ch === '(' || ch === '[') {
|
|
state.f = state.inline = getLinkHrefInside(ch === "(" ? ")" : "]");
|
|
if (modeCfg.highlightFormatting) state.formatting = "link-string";
|
|
state.linkHref = true;
|
|
return getType(state);
|
|
}
|
|
return 'error';
|
|
}
|
|
|
|
var linkRE = {
|
|
")": /^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,
|
|
"]": /^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/
|
|
}
|
|
|
|
function getLinkHrefInside(endChar) {
|
|
return function(stream, state) {
|
|
var ch = stream.next();
|
|
|
|
if (ch === endChar) {
|
|
state.f = state.inline = inlineNormal;
|
|
if (modeCfg.highlightFormatting) state.formatting = "link-string";
|
|
var returnState = getType(state);
|
|
state.linkHref = false;
|
|
return returnState;
|
|
}
|
|
|
|
stream.match(linkRE[endChar])
|
|
state.linkHref = true;
|
|
return getType(state);
|
|
};
|
|
}
|
|
|
|
function footnoteLink(stream, state) {
|
|
if (stream.match(/^([^\]\\]|\\.)*\]:/, false)) {
|
|
state.f = footnoteLinkInside;
|
|
stream.next(); // Consume [
|
|
if (modeCfg.highlightFormatting) state.formatting = "link";
|
|
state.linkText = true;
|
|
return getType(state);
|
|
}
|
|
return switchInline(stream, state, inlineNormal);
|
|
}
|
|
|
|
function footnoteLinkInside(stream, state) {
|
|
if (stream.match(/^\]:/, true)) {
|
|
state.f = state.inline = footnoteUrl;
|
|
if (modeCfg.highlightFormatting) state.formatting = "link";
|
|
var returnType = getType(state);
|
|
state.linkText = false;
|
|
return returnType;
|
|
}
|
|
|
|
stream.match(/^([^\]\\]|\\.)+/, true);
|
|
|
|
return tokenTypes.linkText;
|
|
}
|
|
|
|
function footnoteUrl(stream, state) {
|
|
// Check if space, and return NULL if so (to avoid marking the space)
|
|
if(stream.eatSpace()){
|
|
return null;
|
|
}
|
|
// Match URL
|
|
stream.match(/^[^\s]+/, true);
|
|
// Check for link title
|
|
if (stream.peek() === undefined) { // End of line, set flag to check next line
|
|
state.linkTitle = true;
|
|
} else { // More content on line, check if link title
|
|
stream.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/, true);
|
|
}
|
|
state.f = state.inline = inlineNormal;
|
|
return tokenTypes.linkHref + " url";
|
|
}
|
|
|
|
var mode = {
|
|
startState: function() {
|
|
return {
|
|
f: blockNormal,
|
|
|
|
prevLine: {stream: null},
|
|
thisLine: {stream: null},
|
|
|
|
block: blockNormal,
|
|
htmlState: null,
|
|
indentation: 0,
|
|
|
|
inline: inlineNormal,
|
|
text: handleText,
|
|
|
|
formatting: false,
|
|
linkText: false,
|
|
linkHref: false,
|
|
linkTitle: false,
|
|
code: 0,
|
|
em: false,
|
|
strong: false,
|
|
header: 0,
|
|
setext: 0,
|
|
hr: false,
|
|
taskList: false,
|
|
list: false,
|
|
listStack: [],
|
|
quote: 0,
|
|
trailingSpace: 0,
|
|
trailingSpaceNewLine: false,
|
|
strikethrough: false,
|
|
emoji: false,
|
|
fencedEndRE: null
|
|
};
|
|
},
|
|
|
|
copyState: function(s) {
|
|
return {
|
|
f: s.f,
|
|
|
|
prevLine: s.prevLine,
|
|
thisLine: s.thisLine,
|
|
|
|
block: s.block,
|
|
htmlState: s.htmlState && CodeMirror.copyState(htmlMode, s.htmlState),
|
|
indentation: s.indentation,
|
|
|
|
localMode: s.localMode,
|
|
localState: s.localMode ? CodeMirror.copyState(s.localMode, s.localState) : null,
|
|
|
|
inline: s.inline,
|
|
text: s.text,
|
|
formatting: false,
|
|
linkText: s.linkText,
|
|
linkTitle: s.linkTitle,
|
|
linkHref: s.linkHref,
|
|
code: s.code,
|
|
em: s.em,
|
|
strong: s.strong,
|
|
strikethrough: s.strikethrough,
|
|
emoji: s.emoji,
|
|
header: s.header,
|
|
setext: s.setext,
|
|
hr: s.hr,
|
|
taskList: s.taskList,
|
|
list: s.list,
|
|
listStack: s.listStack.slice(0),
|
|
quote: s.quote,
|
|
indentedCode: s.indentedCode,
|
|
trailingSpace: s.trailingSpace,
|
|
trailingSpaceNewLine: s.trailingSpaceNewLine,
|
|
md_inside: s.md_inside,
|
|
fencedEndRE: s.fencedEndRE
|
|
};
|
|
},
|
|
|
|
token: function(stream, state) {
|
|
|
|
// Reset state.formatting
|
|
state.formatting = false;
|
|
|
|
if (stream != state.thisLine.stream) {
|
|
state.header = 0;
|
|
state.hr = false;
|
|
|
|
if (stream.match(/^\s*$/, true)) {
|
|
blankLine(state);
|
|
return null;
|
|
}
|
|
|
|
state.prevLine = state.thisLine
|
|
state.thisLine = {stream: stream}
|
|
|
|
// Reset state.taskList
|
|
state.taskList = false;
|
|
|
|
// Reset state.trailingSpace
|
|
state.trailingSpace = 0;
|
|
state.trailingSpaceNewLine = false;
|
|
|
|
if (!state.localState) {
|
|
state.f = state.block;
|
|
if (state.f != htmlBlock) {
|
|
var indentation = stream.match(/^\s*/, true)[0].replace(/\t/g, expandedTab).length;
|
|
state.indentation = indentation;
|
|
state.indentationDiff = null;
|
|
if (indentation > 0) return null;
|
|
}
|
|
}
|
|
}
|
|
return state.f(stream, state);
|
|
},
|
|
|
|
innerMode: function(state) {
|
|
if (state.block == htmlBlock) return {state: state.htmlState, mode: htmlMode};
|
|
if (state.localState) return {state: state.localState, mode: state.localMode};
|
|
return {state: state, mode: mode};
|
|
},
|
|
|
|
indent: function(state, textAfter, line) {
|
|
if (state.block == htmlBlock && htmlMode.indent) return htmlMode.indent(state.htmlState, textAfter, line)
|
|
if (state.localState && state.localMode.indent) return state.localMode.indent(state.localState, textAfter, line)
|
|
return CodeMirror.Pass
|
|
},
|
|
|
|
blankLine: blankLine,
|
|
|
|
getType: getType,
|
|
|
|
blockCommentStart: "<!--",
|
|
blockCommentEnd: "-->",
|
|
closeBrackets: "()[]{}''\"\"``",
|
|
fold: "markdown"
|
|
};
|
|
return mode;
|
|
}, "xml");
|
|
|
|
CodeMirror.defineMIME("text/markdown", "markdown");
|
|
|
|
CodeMirror.defineMIME("text/x-markdown", "markdown");
|
|
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 98101:
|
|
/*!*****************************************************************!*\
|
|
!*** ./node_modules/_codemirror@5.58.2@codemirror/mode/meta.js ***!
|
|
\*****************************************************************/
|
|
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
// Distributed under an MIT license: https://codemirror.net/LICENSE
|
|
|
|
(function(mod) {
|
|
if (true) // CommonJS
|
|
mod(__webpack_require__(/*! ../lib/codemirror */ 89780));
|
|
else {}
|
|
})(function(CodeMirror) {
|
|
"use strict";
|
|
|
|
CodeMirror.modeInfo = [
|
|
{name: "APL", mime: "text/apl", mode: "apl", ext: ["dyalog", "apl"]},
|
|
{name: "PGP", mimes: ["application/pgp", "application/pgp-encrypted", "application/pgp-keys", "application/pgp-signature"], mode: "asciiarmor", ext: ["asc", "pgp", "sig"]},
|
|
{name: "ASN.1", mime: "text/x-ttcn-asn", mode: "asn.1", ext: ["asn", "asn1"]},
|
|
{name: "Asterisk", mime: "text/x-asterisk", mode: "asterisk", file: /^extensions\.conf$/i},
|
|
{name: "Brainfuck", mime: "text/x-brainfuck", mode: "brainfuck", ext: ["b", "bf"]},
|
|
{name: "C", mime: "text/x-csrc", mode: "clike", ext: ["c", "h", "ino"]},
|
|
{name: "C++", mime: "text/x-c++src", mode: "clike", ext: ["cpp", "c++", "cc", "cxx", "hpp", "h++", "hh", "hxx"], alias: ["cpp"]},
|
|
{name: "Cobol", mime: "text/x-cobol", mode: "cobol", ext: ["cob", "cpy"]},
|
|
{name: "C#", mime: "text/x-csharp", mode: "clike", ext: ["cs"], alias: ["csharp", "cs"]},
|
|
{name: "Clojure", mime: "text/x-clojure", mode: "clojure", ext: ["clj", "cljc", "cljx"]},
|
|
{name: "ClojureScript", mime: "text/x-clojurescript", mode: "clojure", ext: ["cljs"]},
|
|
{name: "Closure Stylesheets (GSS)", mime: "text/x-gss", mode: "css", ext: ["gss"]},
|
|
{name: "CMake", mime: "text/x-cmake", mode: "cmake", ext: ["cmake", "cmake.in"], file: /^CMakeLists\.txt$/},
|
|
{name: "CoffeeScript", mimes: ["application/vnd.coffeescript", "text/coffeescript", "text/x-coffeescript"], mode: "coffeescript", ext: ["coffee"], alias: ["coffee", "coffee-script"]},
|
|
{name: "Common Lisp", mime: "text/x-common-lisp", mode: "commonlisp", ext: ["cl", "lisp", "el"], alias: ["lisp"]},
|
|
{name: "Cypher", mime: "application/x-cypher-query", mode: "cypher", ext: ["cyp", "cypher"]},
|
|
{name: "Cython", mime: "text/x-cython", mode: "python", ext: ["pyx", "pxd", "pxi"]},
|
|
{name: "Crystal", mime: "text/x-crystal", mode: "crystal", ext: ["cr"]},
|
|
{name: "CSS", mime: "text/css", mode: "css", ext: ["css"]},
|
|
{name: "CQL", mime: "text/x-cassandra", mode: "sql", ext: ["cql"]},
|
|
{name: "D", mime: "text/x-d", mode: "d", ext: ["d"]},
|
|
{name: "Dart", mimes: ["application/dart", "text/x-dart"], mode: "dart", ext: ["dart"]},
|
|
{name: "diff", mime: "text/x-diff", mode: "diff", ext: ["diff", "patch"]},
|
|
{name: "Django", mime: "text/x-django", mode: "django"},
|
|
{name: "Dockerfile", mime: "text/x-dockerfile", mode: "dockerfile", file: /^Dockerfile$/},
|
|
{name: "DTD", mime: "application/xml-dtd", mode: "dtd", ext: ["dtd"]},
|
|
{name: "Dylan", mime: "text/x-dylan", mode: "dylan", ext: ["dylan", "dyl", "intr"]},
|
|
{name: "EBNF", mime: "text/x-ebnf", mode: "ebnf"},
|
|
{name: "ECL", mime: "text/x-ecl", mode: "ecl", ext: ["ecl"]},
|
|
{name: "edn", mime: "application/edn", mode: "clojure", ext: ["edn"]},
|
|
{name: "Eiffel", mime: "text/x-eiffel", mode: "eiffel", ext: ["e"]},
|
|
{name: "Elm", mime: "text/x-elm", mode: "elm", ext: ["elm"]},
|
|
{name: "Embedded Javascript", mime: "application/x-ejs", mode: "htmlembedded", ext: ["ejs"]},
|
|
{name: "Embedded Ruby", mime: "application/x-erb", mode: "htmlembedded", ext: ["erb"]},
|
|
{name: "Erlang", mime: "text/x-erlang", mode: "erlang", ext: ["erl"]},
|
|
{name: "Esper", mime: "text/x-esper", mode: "sql"},
|
|
{name: "Factor", mime: "text/x-factor", mode: "factor", ext: ["factor"]},
|
|
{name: "FCL", mime: "text/x-fcl", mode: "fcl"},
|
|
{name: "Forth", mime: "text/x-forth", mode: "forth", ext: ["forth", "fth", "4th"]},
|
|
{name: "Fortran", mime: "text/x-fortran", mode: "fortran", ext: ["f", "for", "f77", "f90", "f95"]},
|
|
{name: "F#", mime: "text/x-fsharp", mode: "mllike", ext: ["fs"], alias: ["fsharp"]},
|
|
{name: "Gas", mime: "text/x-gas", mode: "gas", ext: ["s"]},
|
|
{name: "Gherkin", mime: "text/x-feature", mode: "gherkin", ext: ["feature"]},
|
|
{name: "GitHub Flavored Markdown", mime: "text/x-gfm", mode: "gfm", file: /^(readme|contributing|history)\.md$/i},
|
|
{name: "Go", mime: "text/x-go", mode: "go", ext: ["go"]},
|
|
{name: "Groovy", mime: "text/x-groovy", mode: "groovy", ext: ["groovy", "gradle"], file: /^Jenkinsfile$/},
|
|
{name: "HAML", mime: "text/x-haml", mode: "haml", ext: ["haml"]},
|
|
{name: "Haskell", mime: "text/x-haskell", mode: "haskell", ext: ["hs"]},
|
|
{name: "Haskell (Literate)", mime: "text/x-literate-haskell", mode: "haskell-literate", ext: ["lhs"]},
|
|
{name: "Haxe", mime: "text/x-haxe", mode: "haxe", ext: ["hx"]},
|
|
{name: "HXML", mime: "text/x-hxml", mode: "haxe", ext: ["hxml"]},
|
|
{name: "ASP.NET", mime: "application/x-aspx", mode: "htmlembedded", ext: ["aspx"], alias: ["asp", "aspx"]},
|
|
{name: "HTML", mime: "text/html", mode: "htmlmixed", ext: ["html", "htm", "handlebars", "hbs"], alias: ["xhtml"]},
|
|
{name: "HTTP", mime: "message/http", mode: "http"},
|
|
{name: "IDL", mime: "text/x-idl", mode: "idl", ext: ["pro"]},
|
|
{name: "Pug", mime: "text/x-pug", mode: "pug", ext: ["jade", "pug"], alias: ["jade"]},
|
|
{name: "Java", mime: "text/x-java", mode: "clike", ext: ["java"]},
|
|
{name: "Java Server Pages", mime: "application/x-jsp", mode: "htmlembedded", ext: ["jsp"], alias: ["jsp"]},
|
|
{name: "JavaScript", mimes: ["text/javascript", "text/ecmascript", "application/javascript", "application/x-javascript", "application/ecmascript"],
|
|
mode: "javascript", ext: ["js"], alias: ["ecmascript", "js", "node"]},
|
|
{name: "JSON", mimes: ["application/json", "application/x-json"], mode: "javascript", ext: ["json", "map"], alias: ["json5"]},
|
|
{name: "JSON-LD", mime: "application/ld+json", mode: "javascript", ext: ["jsonld"], alias: ["jsonld"]},
|
|
{name: "JSX", mime: "text/jsx", mode: "jsx", ext: ["jsx"]},
|
|
{name: "Jinja2", mime: "text/jinja2", mode: "jinja2", ext: ["j2", "jinja", "jinja2"]},
|
|
{name: "Julia", mime: "text/x-julia", mode: "julia", ext: ["jl"]},
|
|
{name: "Kotlin", mime: "text/x-kotlin", mode: "clike", ext: ["kt"]},
|
|
{name: "LESS", mime: "text/x-less", mode: "css", ext: ["less"]},
|
|
{name: "LiveScript", mime: "text/x-livescript", mode: "livescript", ext: ["ls"], alias: ["ls"]},
|
|
{name: "Lua", mime: "text/x-lua", mode: "lua", ext: ["lua"]},
|
|
{name: "Markdown", mime: "text/x-markdown", mode: "markdown", ext: ["markdown", "md", "mkd"]},
|
|
{name: "mIRC", mime: "text/mirc", mode: "mirc"},
|
|
{name: "MariaDB SQL", mime: "text/x-mariadb", mode: "sql"},
|
|
{name: "Mathematica", mime: "text/x-mathematica", mode: "mathematica", ext: ["m", "nb", "wl", "wls"]},
|
|
{name: "Modelica", mime: "text/x-modelica", mode: "modelica", ext: ["mo"]},
|
|
{name: "MUMPS", mime: "text/x-mumps", mode: "mumps", ext: ["mps"]},
|
|
{name: "MS SQL", mime: "text/x-mssql", mode: "sql"},
|
|
{name: "mbox", mime: "application/mbox", mode: "mbox", ext: ["mbox"]},
|
|
{name: "MySQL", mime: "text/x-mysql", mode: "sql"},
|
|
{name: "Nginx", mime: "text/x-nginx-conf", mode: "nginx", file: /nginx.*\.conf$/i},
|
|
{name: "NSIS", mime: "text/x-nsis", mode: "nsis", ext: ["nsh", "nsi"]},
|
|
{name: "NTriples", mimes: ["application/n-triples", "application/n-quads", "text/n-triples"],
|
|
mode: "ntriples", ext: ["nt", "nq"]},
|
|
{name: "Objective-C", mime: "text/x-objectivec", mode: "clike", ext: ["m"], alias: ["objective-c", "objc"]},
|
|
{name: "Objective-C++", mime: "text/x-objectivec++", mode: "clike", ext: ["mm"], alias: ["objective-c++", "objc++"]},
|
|
{name: "OCaml", mime: "text/x-ocaml", mode: "mllike", ext: ["ml", "mli", "mll", "mly"]},
|
|
{name: "Octave", mime: "text/x-octave", mode: "octave", ext: ["m"]},
|
|
{name: "Oz", mime: "text/x-oz", mode: "oz", ext: ["oz"]},
|
|
{name: "Pascal", mime: "text/x-pascal", mode: "pascal", ext: ["p", "pas"]},
|
|
{name: "PEG.js", mime: "null", mode: "pegjs", ext: ["jsonld"]},
|
|
{name: "Perl", mime: "text/x-perl", mode: "perl", ext: ["pl", "pm"]},
|
|
{name: "PHP", mimes: ["text/x-php", "application/x-httpd-php", "application/x-httpd-php-open"], mode: "php", ext: ["php", "php3", "php4", "php5", "php7", "phtml"]},
|
|
{name: "Pig", mime: "text/x-pig", mode: "pig", ext: ["pig"]},
|
|
{name: "Plain Text", mime: "text/plain", mode: "null", ext: ["txt", "text", "conf", "def", "list", "log"]},
|
|
{name: "PLSQL", mime: "text/x-plsql", mode: "sql", ext: ["pls"]},
|
|
{name: "PostgreSQL", mime: "text/x-pgsql", mode: "sql"},
|
|
{name: "PowerShell", mime: "application/x-powershell", mode: "powershell", ext: ["ps1", "psd1", "psm1"]},
|
|
{name: "Properties files", mime: "text/x-properties", mode: "properties", ext: ["properties", "ini", "in"], alias: ["ini", "properties"]},
|
|
{name: "ProtoBuf", mime: "text/x-protobuf", mode: "protobuf", ext: ["proto"]},
|
|
{name: "Python", mime: "text/x-python", mode: "python", ext: ["BUILD", "bzl", "py", "pyw"], file: /^(BUCK|BUILD)$/},
|
|
{name: "Puppet", mime: "text/x-puppet", mode: "puppet", ext: ["pp"]},
|
|
{name: "Q", mime: "text/x-q", mode: "q", ext: ["q"]},
|
|
{name: "R", mime: "text/x-rsrc", mode: "r", ext: ["r", "R"], alias: ["rscript"]},
|
|
{name: "reStructuredText", mime: "text/x-rst", mode: "rst", ext: ["rst"], alias: ["rst"]},
|
|
{name: "RPM Changes", mime: "text/x-rpm-changes", mode: "rpm"},
|
|
{name: "RPM Spec", mime: "text/x-rpm-spec", mode: "rpm", ext: ["spec"]},
|
|
{name: "Ruby", mime: "text/x-ruby", mode: "ruby", ext: ["rb"], alias: ["jruby", "macruby", "rake", "rb", "rbx"]},
|
|
{name: "Rust", mime: "text/x-rustsrc", mode: "rust", ext: ["rs"]},
|
|
{name: "SAS", mime: "text/x-sas", mode: "sas", ext: ["sas"]},
|
|
{name: "Sass", mime: "text/x-sass", mode: "sass", ext: ["sass"]},
|
|
{name: "Scala", mime: "text/x-scala", mode: "clike", ext: ["scala"]},
|
|
{name: "Scheme", mime: "text/x-scheme", mode: "scheme", ext: ["scm", "ss"]},
|
|
{name: "SCSS", mime: "text/x-scss", mode: "css", ext: ["scss"]},
|
|
{name: "Shell", mimes: ["text/x-sh", "application/x-sh"], mode: "shell", ext: ["sh", "ksh", "bash"], alias: ["bash", "sh", "zsh"], file: /^PKGBUILD$/},
|
|
{name: "Sieve", mime: "application/sieve", mode: "sieve", ext: ["siv", "sieve"]},
|
|
{name: "Slim", mimes: ["text/x-slim", "application/x-slim"], mode: "slim", ext: ["slim"]},
|
|
{name: "Smalltalk", mime: "text/x-stsrc", mode: "smalltalk", ext: ["st"]},
|
|
{name: "Smarty", mime: "text/x-smarty", mode: "smarty", ext: ["tpl"]},
|
|
{name: "Solr", mime: "text/x-solr", mode: "solr"},
|
|
{name: "SML", mime: "text/x-sml", mode: "mllike", ext: ["sml", "sig", "fun", "smackspec"]},
|
|
{name: "Soy", mime: "text/x-soy", mode: "soy", ext: ["soy"], alias: ["closure template"]},
|
|
{name: "SPARQL", mime: "application/sparql-query", mode: "sparql", ext: ["rq", "sparql"], alias: ["sparul"]},
|
|
{name: "Spreadsheet", mime: "text/x-spreadsheet", mode: "spreadsheet", alias: ["excel", "formula"]},
|
|
{name: "SQL", mime: "text/x-sql", mode: "sql", ext: ["sql"]},
|
|
{name: "SQLite", mime: "text/x-sqlite", mode: "sql"},
|
|
{name: "Squirrel", mime: "text/x-squirrel", mode: "clike", ext: ["nut"]},
|
|
{name: "Stylus", mime: "text/x-styl", mode: "stylus", ext: ["styl"]},
|
|
{name: "Swift", mime: "text/x-swift", mode: "swift", ext: ["swift"]},
|
|
{name: "sTeX", mime: "text/x-stex", mode: "stex"},
|
|
{name: "LaTeX", mime: "text/x-latex", mode: "stex", ext: ["text", "ltx", "tex"], alias: ["tex"]},
|
|
{name: "SystemVerilog", mime: "text/x-systemverilog", mode: "verilog", ext: ["v", "sv", "svh"]},
|
|
{name: "Tcl", mime: "text/x-tcl", mode: "tcl", ext: ["tcl"]},
|
|
{name: "Textile", mime: "text/x-textile", mode: "textile", ext: ["textile"]},
|
|
{name: "TiddlyWiki", mime: "text/x-tiddlywiki", mode: "tiddlywiki"},
|
|
{name: "Tiki wiki", mime: "text/tiki", mode: "tiki"},
|
|
{name: "TOML", mime: "text/x-toml", mode: "toml", ext: ["toml"]},
|
|
{name: "Tornado", mime: "text/x-tornado", mode: "tornado"},
|
|
{name: "troff", mime: "text/troff", mode: "troff", ext: ["1", "2", "3", "4", "5", "6", "7", "8", "9"]},
|
|
{name: "TTCN", mime: "text/x-ttcn", mode: "ttcn", ext: ["ttcn", "ttcn3", "ttcnpp"]},
|
|
{name: "TTCN_CFG", mime: "text/x-ttcn-cfg", mode: "ttcn-cfg", ext: ["cfg"]},
|
|
{name: "Turtle", mime: "text/turtle", mode: "turtle", ext: ["ttl"]},
|
|
{name: "TypeScript", mime: "application/typescript", mode: "javascript", ext: ["ts"], alias: ["ts"]},
|
|
{name: "TypeScript-JSX", mime: "text/typescript-jsx", mode: "jsx", ext: ["tsx"], alias: ["tsx"]},
|
|
{name: "Twig", mime: "text/x-twig", mode: "twig"},
|
|
{name: "Web IDL", mime: "text/x-webidl", mode: "webidl", ext: ["webidl"]},
|
|
{name: "VB.NET", mime: "text/x-vb", mode: "vb", ext: ["vb"]},
|
|
{name: "VBScript", mime: "text/vbscript", mode: "vbscript", ext: ["vbs"]},
|
|
{name: "Velocity", mime: "text/velocity", mode: "velocity", ext: ["vtl"]},
|
|
{name: "Verilog", mime: "text/x-verilog", mode: "verilog", ext: ["v"]},
|
|
{name: "VHDL", mime: "text/x-vhdl", mode: "vhdl", ext: ["vhd", "vhdl"]},
|
|
{name: "Vue.js Component", mimes: ["script/x-vue", "text/x-vue"], mode: "vue", ext: ["vue"]},
|
|
{name: "XML", mimes: ["application/xml", "text/xml"], mode: "xml", ext: ["xml", "xsl", "xsd", "svg"], alias: ["rss", "wsdl", "xsd"]},
|
|
{name: "XQuery", mime: "application/xquery", mode: "xquery", ext: ["xy", "xquery"]},
|
|
{name: "Yacas", mime: "text/x-yacas", mode: "yacas", ext: ["ys"]},
|
|
{name: "YAML", mimes: ["text/x-yaml", "text/yaml"], mode: "yaml", ext: ["yaml", "yml"], alias: ["yml"]},
|
|
{name: "Z80", mime: "text/x-z80", mode: "z80", ext: ["z80"]},
|
|
{name: "mscgen", mime: "text/x-mscgen", mode: "mscgen", ext: ["mscgen", "mscin", "msc"]},
|
|
{name: "xu", mime: "text/x-xu", mode: "mscgen", ext: ["xu"]},
|
|
{name: "msgenny", mime: "text/x-msgenny", mode: "mscgen", ext: ["msgenny"]},
|
|
{name: "WebAssembly", mime: "text/webassembly", mode: "wast", ext: ["wat", "wast"]},
|
|
];
|
|
// Ensure all modes have a mime property for backwards compatibility
|
|
for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
|
|
var info = CodeMirror.modeInfo[i];
|
|
if (info.mimes) info.mime = info.mimes[0];
|
|
}
|
|
|
|
CodeMirror.findModeByMIME = function(mime) {
|
|
mime = mime.toLowerCase();
|
|
for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
|
|
var info = CodeMirror.modeInfo[i];
|
|
if (info.mime == mime) return info;
|
|
if (info.mimes) for (var j = 0; j < info.mimes.length; j++)
|
|
if (info.mimes[j] == mime) return info;
|
|
}
|
|
if (/\+xml$/.test(mime)) return CodeMirror.findModeByMIME("application/xml")
|
|
if (/\+json$/.test(mime)) return CodeMirror.findModeByMIME("application/json")
|
|
};
|
|
|
|
CodeMirror.findModeByExtension = function(ext) {
|
|
ext = ext.toLowerCase();
|
|
for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
|
|
var info = CodeMirror.modeInfo[i];
|
|
if (info.ext) for (var j = 0; j < info.ext.length; j++)
|
|
if (info.ext[j] == ext) return info;
|
|
}
|
|
};
|
|
|
|
CodeMirror.findModeByFileName = function(filename) {
|
|
for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
|
|
var info = CodeMirror.modeInfo[i];
|
|
if (info.file && info.file.test(filename)) return info;
|
|
}
|
|
var dot = filename.lastIndexOf(".");
|
|
var ext = dot > -1 && filename.substring(dot + 1, filename.length);
|
|
if (ext) return CodeMirror.findModeByExtension(ext);
|
|
};
|
|
|
|
CodeMirror.findModeByName = function(name) {
|
|
name = name.toLowerCase();
|
|
for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
|
|
var info = CodeMirror.modeInfo[i];
|
|
if (info.name.toLowerCase() == name) return info;
|
|
if (info.alias) for (var j = 0; j < info.alias.length; j++)
|
|
if (info.alias[j].toLowerCase() == name) return info;
|
|
}
|
|
};
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 67549:
|
|
/*!**********************************************************************!*\
|
|
!*** ./node_modules/_codemirror@5.58.2@codemirror/mode/stex/stex.js ***!
|
|
\**********************************************************************/
|
|
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
// Distributed under an MIT license: https://codemirror.net/LICENSE
|
|
|
|
/*
|
|
* Author: Constantin Jucovschi (c.jucovschi@jacobs-university.de)
|
|
* Licence: MIT
|
|
*/
|
|
|
|
(function(mod) {
|
|
if (true) // CommonJS
|
|
mod(__webpack_require__(/*! ../../lib/codemirror */ 89780));
|
|
else {}
|
|
})(function(CodeMirror) {
|
|
"use strict";
|
|
|
|
CodeMirror.defineMode("stex", function(_config, parserConfig) {
|
|
"use strict";
|
|
|
|
function pushCommand(state, command) {
|
|
state.cmdState.push(command);
|
|
}
|
|
|
|
function peekCommand(state) {
|
|
if (state.cmdState.length > 0) {
|
|
return state.cmdState[state.cmdState.length - 1];
|
|
} else {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
function popCommand(state) {
|
|
var plug = state.cmdState.pop();
|
|
if (plug) {
|
|
plug.closeBracket();
|
|
}
|
|
}
|
|
|
|
// returns the non-default plugin closest to the end of the list
|
|
function getMostPowerful(state) {
|
|
var context = state.cmdState;
|
|
for (var i = context.length - 1; i >= 0; i--) {
|
|
var plug = context[i];
|
|
if (plug.name == "DEFAULT") {
|
|
continue;
|
|
}
|
|
return plug;
|
|
}
|
|
return { styleIdentifier: function() { return null; } };
|
|
}
|
|
|
|
function addPluginPattern(pluginName, cmdStyle, styles) {
|
|
return function () {
|
|
this.name = pluginName;
|
|
this.bracketNo = 0;
|
|
this.style = cmdStyle;
|
|
this.styles = styles;
|
|
this.argument = null; // \begin and \end have arguments that follow. These are stored in the plugin
|
|
|
|
this.styleIdentifier = function() {
|
|
return this.styles[this.bracketNo - 1] || null;
|
|
};
|
|
this.openBracket = function() {
|
|
this.bracketNo++;
|
|
return "bracket";
|
|
};
|
|
this.closeBracket = function() {};
|
|
};
|
|
}
|
|
|
|
var plugins = {};
|
|
|
|
plugins["importmodule"] = addPluginPattern("importmodule", "tag", ["string", "builtin"]);
|
|
plugins["documentclass"] = addPluginPattern("documentclass", "tag", ["", "atom"]);
|
|
plugins["usepackage"] = addPluginPattern("usepackage", "tag", ["atom"]);
|
|
plugins["begin"] = addPluginPattern("begin", "tag", ["atom"]);
|
|
plugins["end"] = addPluginPattern("end", "tag", ["atom"]);
|
|
|
|
plugins["label" ] = addPluginPattern("label" , "tag", ["atom"]);
|
|
plugins["ref" ] = addPluginPattern("ref" , "tag", ["atom"]);
|
|
plugins["eqref" ] = addPluginPattern("eqref" , "tag", ["atom"]);
|
|
plugins["cite" ] = addPluginPattern("cite" , "tag", ["atom"]);
|
|
plugins["bibitem" ] = addPluginPattern("bibitem" , "tag", ["atom"]);
|
|
plugins["Bibitem" ] = addPluginPattern("Bibitem" , "tag", ["atom"]);
|
|
plugins["RBibitem" ] = addPluginPattern("RBibitem" , "tag", ["atom"]);
|
|
|
|
plugins["DEFAULT"] = function () {
|
|
this.name = "DEFAULT";
|
|
this.style = "tag";
|
|
|
|
this.styleIdentifier = this.openBracket = this.closeBracket = function() {};
|
|
};
|
|
|
|
function setState(state, f) {
|
|
state.f = f;
|
|
}
|
|
|
|
// called when in a normal (no environment) context
|
|
function normal(source, state) {
|
|
var plug;
|
|
// Do we look like '\command' ? If so, attempt to apply the plugin 'command'
|
|
if (source.match(/^\\[a-zA-Z@]+/)) {
|
|
var cmdName = source.current().slice(1);
|
|
plug = plugins.hasOwnProperty(cmdName) ? plugins[cmdName] : plugins["DEFAULT"];
|
|
plug = new plug();
|
|
pushCommand(state, plug);
|
|
setState(state, beginParams);
|
|
return plug.style;
|
|
}
|
|
|
|
// escape characters
|
|
if (source.match(/^\\[$&%#{}_]/)) {
|
|
return "tag";
|
|
}
|
|
|
|
// white space control characters
|
|
if (source.match(/^\\[,;!\/\\]/)) {
|
|
return "tag";
|
|
}
|
|
|
|
// find if we're starting various math modes
|
|
if (source.match("\\[")) {
|
|
setState(state, function(source, state){ return inMathMode(source, state, "\\]"); });
|
|
return "keyword";
|
|
}
|
|
if (source.match("\\(")) {
|
|
setState(state, function(source, state){ return inMathMode(source, state, "\\)"); });
|
|
return "keyword";
|
|
}
|
|
if (source.match("$$")) {
|
|
setState(state, function(source, state){ return inMathMode(source, state, "$$"); });
|
|
return "keyword";
|
|
}
|
|
if (source.match("$")) {
|
|
setState(state, function(source, state){ return inMathMode(source, state, "$"); });
|
|
return "keyword";
|
|
}
|
|
|
|
var ch = source.next();
|
|
if (ch == "%") {
|
|
source.skipToEnd();
|
|
return "comment";
|
|
} else if (ch == '}' || ch == ']') {
|
|
plug = peekCommand(state);
|
|
if (plug) {
|
|
plug.closeBracket(ch);
|
|
setState(state, beginParams);
|
|
} else {
|
|
return "error";
|
|
}
|
|
return "bracket";
|
|
} else if (ch == '{' || ch == '[') {
|
|
plug = plugins["DEFAULT"];
|
|
plug = new plug();
|
|
pushCommand(state, plug);
|
|
return "bracket";
|
|
} else if (/\d/.test(ch)) {
|
|
source.eatWhile(/[\w.%]/);
|
|
return "atom";
|
|
} else {
|
|
source.eatWhile(/[\w\-_]/);
|
|
plug = getMostPowerful(state);
|
|
if (plug.name == 'begin') {
|
|
plug.argument = source.current();
|
|
}
|
|
return plug.styleIdentifier();
|
|
}
|
|
}
|
|
|
|
function inMathMode(source, state, endModeSeq) {
|
|
if (source.eatSpace()) {
|
|
return null;
|
|
}
|
|
if (endModeSeq && source.match(endModeSeq)) {
|
|
setState(state, normal);
|
|
return "keyword";
|
|
}
|
|
if (source.match(/^\\[a-zA-Z@]+/)) {
|
|
return "tag";
|
|
}
|
|
if (source.match(/^[a-zA-Z]+/)) {
|
|
return "variable-2";
|
|
}
|
|
// escape characters
|
|
if (source.match(/^\\[$&%#{}_]/)) {
|
|
return "tag";
|
|
}
|
|
// white space control characters
|
|
if (source.match(/^\\[,;!\/]/)) {
|
|
return "tag";
|
|
}
|
|
// special math-mode characters
|
|
if (source.match(/^[\^_&]/)) {
|
|
return "tag";
|
|
}
|
|
// non-special characters
|
|
if (source.match(/^[+\-<>|=,\/@!*:;'"`~#?]/)) {
|
|
return null;
|
|
}
|
|
if (source.match(/^(\d+\.\d*|\d*\.\d+|\d+)/)) {
|
|
return "number";
|
|
}
|
|
var ch = source.next();
|
|
if (ch == "{" || ch == "}" || ch == "[" || ch == "]" || ch == "(" || ch == ")") {
|
|
return "bracket";
|
|
}
|
|
|
|
if (ch == "%") {
|
|
source.skipToEnd();
|
|
return "comment";
|
|
}
|
|
return "error";
|
|
}
|
|
|
|
function beginParams(source, state) {
|
|
var ch = source.peek(), lastPlug;
|
|
if (ch == '{' || ch == '[') {
|
|
lastPlug = peekCommand(state);
|
|
lastPlug.openBracket(ch);
|
|
source.eat(ch);
|
|
setState(state, normal);
|
|
return "bracket";
|
|
}
|
|
if (/[ \t\r]/.test(ch)) {
|
|
source.eat(ch);
|
|
return null;
|
|
}
|
|
setState(state, normal);
|
|
popCommand(state);
|
|
|
|
return normal(source, state);
|
|
}
|
|
|
|
return {
|
|
startState: function() {
|
|
var f = parserConfig.inMathMode ? function(source, state){ return inMathMode(source, state); } : normal;
|
|
return {
|
|
cmdState: [],
|
|
f: f
|
|
};
|
|
},
|
|
copyState: function(s) {
|
|
return {
|
|
cmdState: s.cmdState.slice(),
|
|
f: s.f
|
|
};
|
|
},
|
|
token: function(stream, state) {
|
|
return state.f(stream, state);
|
|
},
|
|
blankLine: function(state) {
|
|
state.f = normal;
|
|
state.cmdState.length = 0;
|
|
},
|
|
lineComment: "%"
|
|
};
|
|
});
|
|
|
|
CodeMirror.defineMIME("text/x-stex", "stex");
|
|
CodeMirror.defineMIME("text/x-latex", "stex");
|
|
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 15525:
|
|
/*!********************************************************************!*\
|
|
!*** ./node_modules/_codemirror@5.58.2@codemirror/mode/xml/xml.js ***!
|
|
\********************************************************************/
|
|
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
// Distributed under an MIT license: https://codemirror.net/LICENSE
|
|
|
|
(function(mod) {
|
|
if (true) // CommonJS
|
|
mod(__webpack_require__(/*! ../../lib/codemirror */ 89780));
|
|
else {}
|
|
})(function(CodeMirror) {
|
|
"use strict";
|
|
|
|
var htmlConfig = {
|
|
autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,
|
|
'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,
|
|
'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true,
|
|
'track': true, 'wbr': true, 'menuitem': true},
|
|
implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true,
|
|
'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true,
|
|
'th': true, 'tr': true},
|
|
contextGrabbers: {
|
|
'dd': {'dd': true, 'dt': true},
|
|
'dt': {'dd': true, 'dt': true},
|
|
'li': {'li': true},
|
|
'option': {'option': true, 'optgroup': true},
|
|
'optgroup': {'optgroup': true},
|
|
'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true,
|
|
'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true,
|
|
'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,
|
|
'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true,
|
|
'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true},
|
|
'rp': {'rp': true, 'rt': true},
|
|
'rt': {'rp': true, 'rt': true},
|
|
'tbody': {'tbody': true, 'tfoot': true},
|
|
'td': {'td': true, 'th': true},
|
|
'tfoot': {'tbody': true},
|
|
'th': {'td': true, 'th': true},
|
|
'thead': {'tbody': true, 'tfoot': true},
|
|
'tr': {'tr': true}
|
|
},
|
|
doNotIndent: {"pre": true},
|
|
allowUnquoted: true,
|
|
allowMissing: true,
|
|
caseFold: true
|
|
}
|
|
|
|
var xmlConfig = {
|
|
autoSelfClosers: {},
|
|
implicitlyClosed: {},
|
|
contextGrabbers: {},
|
|
doNotIndent: {},
|
|
allowUnquoted: false,
|
|
allowMissing: false,
|
|
allowMissingTagName: false,
|
|
caseFold: false
|
|
}
|
|
|
|
CodeMirror.defineMode("xml", function(editorConf, config_) {
|
|
var indentUnit = editorConf.indentUnit
|
|
var config = {}
|
|
var defaults = config_.htmlMode ? htmlConfig : xmlConfig
|
|
for (var prop in defaults) config[prop] = defaults[prop]
|
|
for (var prop in config_) config[prop] = config_[prop]
|
|
|
|
// Return variables for tokenizers
|
|
var type, setStyle;
|
|
|
|
function inText(stream, state) {
|
|
function chain(parser) {
|
|
state.tokenize = parser;
|
|
return parser(stream, state);
|
|
}
|
|
|
|
var ch = stream.next();
|
|
if (ch == "<") {
|
|
if (stream.eat("!")) {
|
|
if (stream.eat("[")) {
|
|
if (stream.match("CDATA[")) return chain(inBlock("atom", "]]>"));
|
|
else return null;
|
|
} else if (stream.match("--")) {
|
|
return chain(inBlock("comment", "-->"));
|
|
} else if (stream.match("DOCTYPE", true, true)) {
|
|
stream.eatWhile(/[\w\._\-]/);
|
|
return chain(doctype(1));
|
|
} else {
|
|
return null;
|
|
}
|
|
} else if (stream.eat("?")) {
|
|
stream.eatWhile(/[\w\._\-]/);
|
|
state.tokenize = inBlock("meta", "?>");
|
|
return "meta";
|
|
} else {
|
|
type = stream.eat("/") ? "closeTag" : "openTag";
|
|
state.tokenize = inTag;
|
|
return "tag bracket";
|
|
}
|
|
} else if (ch == "&") {
|
|
var ok;
|
|
if (stream.eat("#")) {
|
|
if (stream.eat("x")) {
|
|
ok = stream.eatWhile(/[a-fA-F\d]/) && stream.eat(";");
|
|
} else {
|
|
ok = stream.eatWhile(/[\d]/) && stream.eat(";");
|
|
}
|
|
} else {
|
|
ok = stream.eatWhile(/[\w\.\-:]/) && stream.eat(";");
|
|
}
|
|
return ok ? "atom" : "error";
|
|
} else {
|
|
stream.eatWhile(/[^&<]/);
|
|
return null;
|
|
}
|
|
}
|
|
inText.isInText = true;
|
|
|
|
function inTag(stream, state) {
|
|
var ch = stream.next();
|
|
if (ch == ">" || (ch == "/" && stream.eat(">"))) {
|
|
state.tokenize = inText;
|
|
type = ch == ">" ? "endTag" : "selfcloseTag";
|
|
return "tag bracket";
|
|
} else if (ch == "=") {
|
|
type = "equals";
|
|
return null;
|
|
} else if (ch == "<") {
|
|
state.tokenize = inText;
|
|
state.state = baseState;
|
|
state.tagName = state.tagStart = null;
|
|
var next = state.tokenize(stream, state);
|
|
return next ? next + " tag error" : "tag error";
|
|
} else if (/[\'\"]/.test(ch)) {
|
|
state.tokenize = inAttribute(ch);
|
|
state.stringStartCol = stream.column();
|
|
return state.tokenize(stream, state);
|
|
} else {
|
|
stream.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/);
|
|
return "word";
|
|
}
|
|
}
|
|
|
|
function inAttribute(quote) {
|
|
var closure = function(stream, state) {
|
|
while (!stream.eol()) {
|
|
if (stream.next() == quote) {
|
|
state.tokenize = inTag;
|
|
break;
|
|
}
|
|
}
|
|
return "string";
|
|
};
|
|
closure.isInAttribute = true;
|
|
return closure;
|
|
}
|
|
|
|
function inBlock(style, terminator) {
|
|
return function(stream, state) {
|
|
while (!stream.eol()) {
|
|
if (stream.match(terminator)) {
|
|
state.tokenize = inText;
|
|
break;
|
|
}
|
|
stream.next();
|
|
}
|
|
return style;
|
|
}
|
|
}
|
|
|
|
function doctype(depth) {
|
|
return function(stream, state) {
|
|
var ch;
|
|
while ((ch = stream.next()) != null) {
|
|
if (ch == "<") {
|
|
state.tokenize = doctype(depth + 1);
|
|
return state.tokenize(stream, state);
|
|
} else if (ch == ">") {
|
|
if (depth == 1) {
|
|
state.tokenize = inText;
|
|
break;
|
|
} else {
|
|
state.tokenize = doctype(depth - 1);
|
|
return state.tokenize(stream, state);
|
|
}
|
|
}
|
|
}
|
|
return "meta";
|
|
};
|
|
}
|
|
|
|
function Context(state, tagName, startOfLine) {
|
|
this.prev = state.context;
|
|
this.tagName = tagName;
|
|
this.indent = state.indented;
|
|
this.startOfLine = startOfLine;
|
|
if (config.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent))
|
|
this.noIndent = true;
|
|
}
|
|
function popContext(state) {
|
|
if (state.context) state.context = state.context.prev;
|
|
}
|
|
function maybePopContext(state, nextTagName) {
|
|
var parentTagName;
|
|
while (true) {
|
|
if (!state.context) {
|
|
return;
|
|
}
|
|
parentTagName = state.context.tagName;
|
|
if (!config.contextGrabbers.hasOwnProperty(parentTagName) ||
|
|
!config.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {
|
|
return;
|
|
}
|
|
popContext(state);
|
|
}
|
|
}
|
|
|
|
function baseState(type, stream, state) {
|
|
if (type == "openTag") {
|
|
state.tagStart = stream.column();
|
|
return tagNameState;
|
|
} else if (type == "closeTag") {
|
|
return closeTagNameState;
|
|
} else {
|
|
return baseState;
|
|
}
|
|
}
|
|
function tagNameState(type, stream, state) {
|
|
if (type == "word") {
|
|
state.tagName = stream.current();
|
|
setStyle = "tag";
|
|
return attrState;
|
|
} else if (config.allowMissingTagName && type == "endTag") {
|
|
setStyle = "tag bracket";
|
|
return attrState(type, stream, state);
|
|
} else {
|
|
setStyle = "error";
|
|
return tagNameState;
|
|
}
|
|
}
|
|
function closeTagNameState(type, stream, state) {
|
|
if (type == "word") {
|
|
var tagName = stream.current();
|
|
if (state.context && state.context.tagName != tagName &&
|
|
config.implicitlyClosed.hasOwnProperty(state.context.tagName))
|
|
popContext(state);
|
|
if ((state.context && state.context.tagName == tagName) || config.matchClosing === false) {
|
|
setStyle = "tag";
|
|
return closeState;
|
|
} else {
|
|
setStyle = "tag error";
|
|
return closeStateErr;
|
|
}
|
|
} else if (config.allowMissingTagName && type == "endTag") {
|
|
setStyle = "tag bracket";
|
|
return closeState(type, stream, state);
|
|
} else {
|
|
setStyle = "error";
|
|
return closeStateErr;
|
|
}
|
|
}
|
|
|
|
function closeState(type, _stream, state) {
|
|
if (type != "endTag") {
|
|
setStyle = "error";
|
|
return closeState;
|
|
}
|
|
popContext(state);
|
|
return baseState;
|
|
}
|
|
function closeStateErr(type, stream, state) {
|
|
setStyle = "error";
|
|
return closeState(type, stream, state);
|
|
}
|
|
|
|
function attrState(type, _stream, state) {
|
|
if (type == "word") {
|
|
setStyle = "attribute";
|
|
return attrEqState;
|
|
} else if (type == "endTag" || type == "selfcloseTag") {
|
|
var tagName = state.tagName, tagStart = state.tagStart;
|
|
state.tagName = state.tagStart = null;
|
|
if (type == "selfcloseTag" ||
|
|
config.autoSelfClosers.hasOwnProperty(tagName)) {
|
|
maybePopContext(state, tagName);
|
|
} else {
|
|
maybePopContext(state, tagName);
|
|
state.context = new Context(state, tagName, tagStart == state.indented);
|
|
}
|
|
return baseState;
|
|
}
|
|
setStyle = "error";
|
|
return attrState;
|
|
}
|
|
function attrEqState(type, stream, state) {
|
|
if (type == "equals") return attrValueState;
|
|
if (!config.allowMissing) setStyle = "error";
|
|
return attrState(type, stream, state);
|
|
}
|
|
function attrValueState(type, stream, state) {
|
|
if (type == "string") return attrContinuedState;
|
|
if (type == "word" && config.allowUnquoted) {setStyle = "string"; return attrState;}
|
|
setStyle = "error";
|
|
return attrState(type, stream, state);
|
|
}
|
|
function attrContinuedState(type, stream, state) {
|
|
if (type == "string") return attrContinuedState;
|
|
return attrState(type, stream, state);
|
|
}
|
|
|
|
return {
|
|
startState: function(baseIndent) {
|
|
var state = {tokenize: inText,
|
|
state: baseState,
|
|
indented: baseIndent || 0,
|
|
tagName: null, tagStart: null,
|
|
context: null}
|
|
if (baseIndent != null) state.baseIndent = baseIndent
|
|
return state
|
|
},
|
|
|
|
token: function(stream, state) {
|
|
if (!state.tagName && stream.sol())
|
|
state.indented = stream.indentation();
|
|
|
|
if (stream.eatSpace()) return null;
|
|
type = null;
|
|
var style = state.tokenize(stream, state);
|
|
if ((style || type) && style != "comment") {
|
|
setStyle = null;
|
|
state.state = state.state(type || style, stream, state);
|
|
if (setStyle)
|
|
style = setStyle == "error" ? style + " error" : setStyle;
|
|
}
|
|
return style;
|
|
},
|
|
|
|
indent: function(state, textAfter, fullLine) {
|
|
var context = state.context;
|
|
// Indent multi-line strings (e.g. css).
|
|
if (state.tokenize.isInAttribute) {
|
|
if (state.tagStart == state.indented)
|
|
return state.stringStartCol + 1;
|
|
else
|
|
return state.indented + indentUnit;
|
|
}
|
|
if (context && context.noIndent) return CodeMirror.Pass;
|
|
if (state.tokenize != inTag && state.tokenize != inText)
|
|
return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0;
|
|
// Indent the starts of attribute names.
|
|
if (state.tagName) {
|
|
if (config.multilineTagIndentPastTag !== false)
|
|
return state.tagStart + state.tagName.length + 2;
|
|
else
|
|
return state.tagStart + indentUnit * (config.multilineTagIndentFactor || 1);
|
|
}
|
|
if (config.alignCDATA && /<!\[CDATA\[/.test(textAfter)) return 0;
|
|
var tagAfter = textAfter && /^<(\/)?([\w_:\.-]*)/.exec(textAfter);
|
|
if (tagAfter && tagAfter[1]) { // Closing tag spotted
|
|
while (context) {
|
|
if (context.tagName == tagAfter[2]) {
|
|
context = context.prev;
|
|
break;
|
|
} else if (config.implicitlyClosed.hasOwnProperty(context.tagName)) {
|
|
context = context.prev;
|
|
} else {
|
|
break;
|
|
}
|
|
}
|
|
} else if (tagAfter) { // Opening tag spotted
|
|
while (context) {
|
|
var grabbers = config.contextGrabbers[context.tagName];
|
|
if (grabbers && grabbers.hasOwnProperty(tagAfter[2]))
|
|
context = context.prev;
|
|
else
|
|
break;
|
|
}
|
|
}
|
|
while (context && context.prev && !context.startOfLine)
|
|
context = context.prev;
|
|
if (context) return context.indent + indentUnit;
|
|
else return state.baseIndent || 0;
|
|
},
|
|
|
|
electricInput: /<\/[\s\w:]+>$/,
|
|
blockCommentStart: "<!--",
|
|
blockCommentEnd: "-->",
|
|
|
|
configuration: config.htmlMode ? "html" : "xml",
|
|
helperType: config.htmlMode ? "html" : "xml",
|
|
|
|
skipAttribute: function(state) {
|
|
if (state.state == attrValueState)
|
|
state.state = attrState
|
|
},
|
|
|
|
xmlCurrentTag: function(state) {
|
|
return state.tagName ? {name: state.tagName, close: state.type == "closeTag"} : null
|
|
},
|
|
|
|
xmlCurrentContext: function(state) {
|
|
var context = []
|
|
for (var cx = state.context; cx; cx = cx.prev)
|
|
if (cx.tagName) context.push(cx.tagName)
|
|
return context.reverse()
|
|
}
|
|
};
|
|
});
|
|
|
|
CodeMirror.defineMIME("text/xml", "xml");
|
|
CodeMirror.defineMIME("application/xml", "xml");
|
|
if (!CodeMirror.mimeModes.hasOwnProperty("text/html"))
|
|
CodeMirror.defineMIME("text/html", {name: "xml", htmlMode: true});
|
|
|
|
});
|
|
|
|
|
|
/***/ })
|
|
|
|
}]); |