UNPKG

yanzi-monaco-editor

Version:

这是一个基于微软的monaco和vue封装的一个代码编辑器,浏览器可运行。主要功能有:html、javascript、css代码编辑,高亮显示,语法错误提示等,可以帮您的项目很快的拥有一个web端的代码编辑器

110 lines (104 loc) 4.39 kB
((typeof self !== 'undefined' ? self : this)["webpackJsonpyanziMonacoEditor"] = (typeof self !== 'undefined' ? self : this)["webpackJsonpyanziMonacoEditor"] || []).push([[70],{ /***/ "0a31": /***/ (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 _fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("424e"); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ var conf = { comments: { blockComment: ['<!--', '-->'] }, brackets: [['<', '>']], autoClosingPairs: [ { open: '<', close: '>' }, { open: "'", close: "'" }, { open: '"', close: '"' } ], surroundingPairs: [ { open: '<', close: '>' }, { open: "'", close: "'" }, { open: '"', close: '"' } ], onEnterRules: [ { beforeText: new RegExp("<([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$", 'i'), afterText: /^<\/([_:\w][_:\w-.\d]*)\s*>$/i, action: { indentAction: _fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_0__["languages"].IndentAction.IndentOutdent } }, { beforeText: new RegExp("<(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$", 'i'), action: { indentAction: _fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_0__["languages"].IndentAction.Indent } } ] }; var language = { defaultToken: '', tokenPostfix: '.xml', ignoreCase: true, // Useful regular expressions qualifiedName: /(?:[\w\.\-]+:)?[\w\.\-]+/, tokenizer: { root: [ [/[^<&]+/, ''], { include: '@whitespace' }, // Standard opening tag [/(<)(@qualifiedName)/, [{ token: 'delimiter' }, { token: 'tag', next: '@tag' }]], // Standard closing tag [ /(<\/)(@qualifiedName)(\s*)(>)/, [{ token: 'delimiter' }, { token: 'tag' }, '', { token: 'delimiter' }] ], // Meta tags - instruction [/(<\?)(@qualifiedName)/, [{ token: 'delimiter' }, { token: 'metatag', next: '@tag' }]], // Meta tags - declaration [/(<\!)(@qualifiedName)/, [{ token: 'delimiter' }, { token: 'metatag', next: '@tag' }]], // CDATA [/<\!\[CDATA\[/, { token: 'delimiter.cdata', next: '@cdata' }], [/&\w+;/, 'string.escape'] ], cdata: [ [/[^\]]+/, ''], [/\]\]>/, { token: 'delimiter.cdata', next: '@pop' }], [/\]/, ''] ], tag: [ [/[ \t\r\n]+/, ''], [ /(@qualifiedName)(\s*=\s*)("[^"]*"|'[^']*')/, ['attribute.name', '', 'attribute.value'] ], [ /(@qualifiedName)(\s*=\s*)("[^">?\/]*|'[^'>?\/]*)(?=[\?\/]\>)/, ['attribute.name', '', 'attribute.value'] ], [ /(@qualifiedName)(\s*=\s*)("[^">]*|'[^'>]*)/, ['attribute.name', '', 'attribute.value'] ], [/@qualifiedName/, 'attribute.name'], [/\?>/, { token: 'delimiter', next: '@pop' }], [/(\/)(>)/, [{ token: 'tag' }, { token: 'delimiter', next: '@pop' }]], [/>/, { token: 'delimiter', next: '@pop' }] ], whitespace: [ [/[ \t\r\n]+/, ''], [/<!--/, { token: 'comment', next: '@comment' }] ], comment: [ [/[^<\-]+/, 'comment.content'], [/-->/, { token: 'comment', next: '@pop' }], [/<!--/, 'comment.content.invalid'], [/[<\-]/, 'comment.content'] ] } }; /***/ }) }]);