yanzi-monaco-editorbb
Version:
这是一个基于微软的monaco和vue封装的一个代码编辑器,浏览器可运行。主要功能有:html、javascript、css代码编辑,高亮显示,语法错误提示等,可以帮您的项目很快的拥有一个web端的代码编辑器
187 lines (176 loc) • 7.49 kB
JavaScript
((typeof self !== 'undefined' ? self : this)["webpackJsonpyanziMonacoEditor"] = (typeof self !== 'undefined' ? self : this)["webpackJsonpyanziMonacoEditor"] || []).push([[37],{
/***/ "3e14":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conf", function() { return conf; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "language", function() { return language; });
/* harmony import */ var core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("4d63");
/* harmony import */ var core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var core_js_modules_es_regexp_dot_all_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("c607");
/* harmony import */ var core_js_modules_es_regexp_dot_all_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_dot_all_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("ac1f");
/* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var core_js_modules_es_regexp_sticky_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("2c3e");
/* harmony import */ var core_js_modules_es_regexp_sticky_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_sticky_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("25f0");
/* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_4__);
/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.32.1(29a273516805a852aa8edc5e05059f119b13eff0)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/
// src/basic-languages/markdown/markdown.ts
var conf = {
comments: {
blockComment: ["<!--", "-->"]
},
brackets: [["{", "}"], ["[", "]"], ["(", ")"]],
autoClosingPairs: [{
open: "{",
close: "}"
}, {
open: "[",
close: "]"
}, {
open: "(",
close: ")"
}, {
open: "<",
close: ">",
notIn: ["string"]
}],
surroundingPairs: [{
open: "(",
close: ")"
}, {
open: "[",
close: "]"
}, {
open: "`",
close: "`"
}],
folding: {
markers: {
start: new RegExp("^\\s*<!--\\s*#?region\\b.*-->"),
end: new RegExp("^\\s*<!--\\s*#?endregion\\b.*-->")
}
}
};
var language = {
defaultToken: "",
tokenPostfix: ".md",
control: /[\\`*_\[\]{}()#+\-\.!]/,
noncontrol: /[^\\`*_\[\]{}()#+\-\.!]/,
escapes: /\\(?:@control)/,
jsescapes: /\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,
empty: ["area", "base", "basefont", "br", "col", "frame", "hr", "img", "input", "isindex", "link", "meta", "param"],
tokenizer: {
root: [[/^\s*\|/, "@rematch", "@table_header"], [/^(\s{0,3})(#+)((?:[^\\#]|@escapes)+)((?:#+)?)/, ["white", "keyword", "keyword", "keyword"]], [/^\s*(=+|\-+)\s*$/, "keyword"], [/^\s*((\*[ ]?)+)\s*$/, "meta.separator"], [/^\s*>+/, "comment"], [/^\s*([\*\-+:]|\d+\.)\s/, "keyword"], [/^(\t|[ ]{4})[^ ].*$/, "string"], [/^\s*~~~\s*((?:\w|[\/\-#])+)?\s*$/, {
token: "string",
next: "@codeblock"
}], [/^\s*```\s*((?:\w|[\/\-#])+).*$/, {
token: "string",
next: "@codeblockgh",
nextEmbedded: "$1"
}], [/^\s*```\s*$/, {
token: "string",
next: "@codeblock"
}], {
include: "@linecontent"
}],
table_header: [{
include: "@table_common"
}, [/[^\|]+/, "keyword.table.header"]],
table_body: [{
include: "@table_common"
}, {
include: "@linecontent"
}],
table_common: [[/\s*[\-:]+\s*/, {
token: "keyword",
switchTo: "table_body"
}], [/^\s*\|/, "keyword.table.left"], [/^\s*[^\|]/, "@rematch", "@pop"], [/^\s*$/, "@rematch", "@pop"], [/\|/, {
cases: {
"@eos": "keyword.table.right",
"@default": "keyword.table.middle"
}
}]],
codeblock: [[/^\s*~~~\s*$/, {
token: "string",
next: "@pop"
}], [/^\s*```\s*$/, {
token: "string",
next: "@pop"
}], [/.*$/, "variable.source"]],
codeblockgh: [[/```\s*$/, {
token: "string",
next: "@pop",
nextEmbedded: "@pop"
}], [/[^`]+/, "variable.source"]],
linecontent: [[/&\w+;/, "string.escape"], [/@escapes/, "escape"], [/\b__([^\\_]|@escapes|_(?!_))+__\b/, "strong"], [/\*\*([^\\*]|@escapes|\*(?!\*))+\*\*/, "strong"], [/\b_[^_]+_\b/, "emphasis"], [/\*([^\\*]|@escapes)+\*/, "emphasis"], [/`([^\\`]|@escapes)+`/, "variable"], [/\{+[^}]+\}+/, "string.target"], [/(!?\[)((?:[^\]\\]|@escapes)*)(\]\([^\)]+\))/, ["string.link", "", "string.link"]], [/(!?\[)((?:[^\]\\]|@escapes)*)(\])/, "string.link"], {
include: "html"
}],
html: [[/<(\w+)\/>/, "tag"], [/<(\w+)(\-|\w)*/, {
cases: {
"@empty": {
token: "tag",
next: "@tag.$1"
},
"@default": {
token: "tag",
next: "@tag.$1"
}
}
}], [/<\/(\w+)(\-|\w)*\s*>/, {
token: "tag"
}], [/<!--/, "comment", "@comment"]],
comment: [[/[^<\-]+/, "comment.content"], [/-->/, "comment", "@pop"], [/<!--/, "comment.content.invalid"], [/[<\-]/, "comment.content"]],
tag: [[/[ \t\r\n]+/, "white"], [/(type)(\s*=\s*)(")([^"]+)(")/, ["attribute.name.html", "delimiter.html", "string.html", {
token: "string.html",
switchTo: "@tag.$S2.$4"
}, "string.html"]], [/(type)(\s*=\s*)(')([^']+)(')/, ["attribute.name.html", "delimiter.html", "string.html", {
token: "string.html",
switchTo: "@tag.$S2.$4"
}, "string.html"]], [/(\w+)(\s*=\s*)("[^"]*"|'[^']*')/, ["attribute.name.html", "delimiter.html", "string.html"]], [/\w+/, "attribute.name.html"], [/\/>/, "tag", "@pop"], [/>/, {
cases: {
"$S2==style": {
token: "tag",
switchTo: "embeddedStyle",
nextEmbedded: "text/css"
},
"$S2==script": {
cases: {
$S3: {
token: "tag",
switchTo: "embeddedScript",
nextEmbedded: "$S3"
},
"@default": {
token: "tag",
switchTo: "embeddedScript",
nextEmbedded: "text/javascript"
}
}
},
"@default": {
token: "tag",
next: "@pop"
}
}
}]],
embeddedStyle: [[/[^<]+/, ""], [/<\/style\s*>/, {
token: "@rematch",
next: "@pop",
nextEmbedded: "@pop"
}], [/</, ""]],
embeddedScript: [[/[^<]+/, ""], [/<\/script\s*>/, {
token: "@rematch",
next: "@pop",
nextEmbedded: "@pop"
}], [/</, ""]]
}
};
/***/ })
}]);