`):
*
* ```javascript
* var hljs = require('highlight.js') // https://highlightjs.org/
*
* // Actual default values
* var md = require('markdown-it')({
* highlight: function (str, lang) {
* if (lang && hljs.getLanguage(lang)) {
* try {
* return '' +
* hljs.highlight(str, { language: lang, ignoreIllegals: true }).value +
* '
';
* } catch (__) {}
* }
*
* return '' + md.utils.escapeHtml(str) + '
';
* }
* });
* ```
*
**/
function MarkdownIt(presetName, options) {
if (!(this instanceof MarkdownIt)) {
return new MarkdownIt(presetName, options);
}
if (!options) {
if (!utils.isString(presetName)) {
options = presetName || {};
presetName = 'default';
}
}
/**
* MarkdownIt#inline -> ParserInline
*
* Instance of [[ParserInline]]. You may need it to add new rules when
* writing plugins. For simple rules control use [[MarkdownIt.disable]] and
* [[MarkdownIt.enable]].
**/
this.inline = new ParserInline();
/**
* MarkdownIt#block -> ParserBlock
*
* Instance of [[ParserBlock]]. You may need it to add new rules when
* writing plugins. For simple rules control use [[MarkdownIt.disable]] and
* [[MarkdownIt.enable]].
**/
this.block = new ParserBlock();
/**
* MarkdownIt#core -> Core
*
* Instance of [[Core]] chain executor. You may need it to add new rules when
* writing plugins. For simple rules control use [[MarkdownIt.disable]] and
* [[MarkdownIt.enable]].
**/
this.core = new ParserCore();
/**
* MarkdownIt#renderer -> Renderer
*
* Instance of [[Renderer]]. Use it to modify output look. Or to add rendering
* rules for new token types, generated by plugins.
*
* ##### Example
*
* ```javascript
* var md = require('markdown-it')();
*
* function myToken(tokens, idx, options, env, self) {
* //...
* return result;
* };
*
* md.renderer.rules['my_token'] = myToken
* ```
*
* See [[Renderer]] docs and [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js).
**/
this.renderer = new Renderer();
/**
* MarkdownIt#linkify -> LinkifyIt
*
* [linkify-it](https://github.com/markdown-it/linkify-it) instance.
* Used by [linkify](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/linkify.js)
* rule.
**/
this.linkify = new LinkifyIt();
/**
* MarkdownIt#validateLink(url) -> Boolean
*
* Link validation function. CommonMark allows too much in links. By default
* we disable `javascript:`, `vbscript:`, `file:` schemas, and almost all `data:...` schemas
* except some embedded image types.
*
* You can change this behaviour:
*
* ```javascript
* var md = require('markdown-it')();
* // enable everything
* md.validateLink = function () { return true; }
* ```
**/
this.validateLink = validateLink;
/**
* MarkdownIt#normalizeLink(url) -> String
*
* Function used to encode link url to a machine-readable format,
* which includes url-encoding, punycode, etc.
**/
this.normalizeLink = normalizeLink;
/**
* MarkdownIt#normalizeLinkText(url) -> String
*
* Function used to decode link url to a human-readable format`
**/
this.normalizeLinkText = normalizeLinkText;
// Expose utils & helpers for easy acces from plugins
/**
* MarkdownIt#utils -> utils
*
* Assorted utility functions, useful to write plugins. See details
* [here](https://github.com/markdown-it/markdown-it/blob/master/lib/common/utils.js).
**/
this.utils = utils;
/**
* MarkdownIt#helpers -> helpers
*
* Link components parser functions, useful to write plugins. See details
* [here](https://github.com/markdown-it/markdown-it/blob/master/lib/helpers).
**/
this.helpers = utils.assign({}, helpers);
this.options = {};
this.configure(presetName);
if (options) { this.set(options); }
}
/** chainable
* MarkdownIt.set(options)
*
* Set parser options (in the same format as in constructor). Probably, you
* will never need it, but you can change options after constructor call.
*
* ##### Example
*
* ```javascript
* var md = require('markdown-it')()
* .set({ html: true, breaks: true })
* .set({ typographer, true });
* ```
*
* __Note:__ To achieve the best possible performance, don't modify a
* `markdown-it` instance options on the fly. If you need multiple configurations
* it's best to create multiple instances and initialize each with separate
* config.
**/
MarkdownIt.prototype.set = function (options) {
utils.assign(this.options, options);
return this;
};
/** chainable, internal
* MarkdownIt.configure(presets)
*
* Batch load of all options and compenent settings. This is internal method,
* and you probably will not need it. But if you will - see available presets
* and data structure [here](https://github.com/markdown-it/markdown-it/tree/master/lib/presets)
*
* We strongly recommend to use presets instead of direct config loads. That
* will give better compatibility with next versions.
**/
MarkdownIt.prototype.configure = function (presets) {
var self = this, presetName;
if (utils.isString(presets)) {
presetName = presets;
presets = config[presetName];
if (!presets) { throw new Error('Wrong `markdown-it` preset "' + presetName + '", check name'); }
}
if (!presets) { throw new Error('Wrong `markdown-it` preset, can\'t be empty'); }
if (presets.options) { self.set(presets.options); }
if (presets.components) {
Object.keys(presets.components).forEach(function (name) {
if (presets.components[name].rules) {
self[name].ruler.enableOnly(presets.components[name].rules);
}
if (presets.components[name].rules2) {
self[name].ruler2.enableOnly(presets.components[name].rules2);
}
});
}
return this;
};
/** chainable
* MarkdownIt.enable(list, ignoreInvalid)
* - list (String|Array): rule name or list of rule names to enable
* - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
*
* Enable list or rules. It will automatically find appropriate components,
* containing rules with given names. If rule not found, and `ignoreInvalid`
* not set - throws exception.
*
* ##### Example
*
* ```javascript
* var md = require('markdown-it')()
* .enable(['sub', 'sup'])
* .disable('smartquotes');
* ```
**/
MarkdownIt.prototype.enable = function (list, ignoreInvalid) {
var result = [];
if (!Array.isArray(list)) { list = [ list ]; }
[ 'core', 'block', 'inline' ].forEach(function (chain) {
result = result.concat(this[chain].ruler.enable(list, true));
}, this);
result = result.concat(this.inline.ruler2.enable(list, true));
var missed = list.filter(function (name) { return result.indexOf(name) < 0; });
if (missed.length && !ignoreInvalid) {
throw new Error('MarkdownIt. Failed to enable unknown rule(s): ' + missed);
}
return this;
};
/** chainable
* MarkdownIt.disable(list, ignoreInvalid)
* - list (String|Array): rule name or list of rule names to disable.
* - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
*
* The same as [[MarkdownIt.enable]], but turn specified rules off.
**/
MarkdownIt.prototype.disable = function (list, ignoreInvalid) {
var result = [];
if (!Array.isArray(list)) { list = [ list ]; }
[ 'core', 'block', 'inline' ].forEach(function (chain) {
result = result.concat(this[chain].ruler.disable(list, true));
}, this);
result = result.concat(this.inline.ruler2.disable(list, true));
var missed = list.filter(function (name) { return result.indexOf(name) < 0; });
if (missed.length && !ignoreInvalid) {
throw new Error('MarkdownIt. Failed to disable unknown rule(s): ' + missed);
}
return this;
};
/** chainable
* MarkdownIt.use(plugin, params)
*
* Load specified plugin with given params into current parser instance.
* It's just a sugar to call `plugin(md, params)` with curring.
*
* ##### Example
*
* ```javascript
* var iterator = require('markdown-it-for-inline');
* var md = require('markdown-it')()
* .use(iterator, 'foo_replace', 'text', function (tokens, idx) {
* tokens[idx].content = tokens[idx].content.replace(/foo/g, 'bar');
* });
* ```
**/
MarkdownIt.prototype.use = function (plugin /*, params, ... */) {
var args = [ this ].concat(Array.prototype.slice.call(arguments, 1));
plugin.apply(plugin, args);
return this;
};
/** internal
* MarkdownIt.parse(src, env) -> Array
* - src (String): source string
* - env (Object): environment sandbox
*
* Parse input string and return list of block tokens (special token type
* "inline" will contain list of inline tokens). You should not call this
* method directly, until you write custom renderer (for example, to produce
* AST).
*
* `env` is used to pass data between "distributed" rules and return additional
* metadata like reference info, needed for the renderer. It also can be used to
* inject data in specific cases. Usually, you will be ok to pass `{}`,
* and then pass updated object to renderer.
**/
MarkdownIt.prototype.parse = function (src, env) {
if (typeof src !== 'string') {
throw new Error('Input data should be a String');
}
var state = new this.core.State(src, this, env);
this.core.process(state);
return state.tokens;
};
/**
* MarkdownIt.render(src [, env]) -> String
* - src (String): source string
* - env (Object): environment sandbox
*
* Render markdown string into html. It does all magic for you :).
*
* `env` can be used to inject additional metadata (`{}` by default).
* But you will not need it with high probability. See also comment
* in [[MarkdownIt.parse]].
**/
MarkdownIt.prototype.render = function (src, env) {
env = env || {};
return this.renderer.render(this.parse(src, env), this.options, env);
};
/** internal
* MarkdownIt.parseInline(src, env) -> Array
* - src (String): source string
* - env (Object): environment sandbox
*
* The same as [[MarkdownIt.parse]] but skip all block rules. It returns the
* block tokens list with the single `inline` element, containing parsed inline
* tokens in `children` property. Also updates `env` object.
**/
MarkdownIt.prototype.parseInline = function (src, env) {
var state = new this.core.State(src, this, env);
state.inlineMode = true;
this.core.process(state);
return state.tokens;
};
/**
* MarkdownIt.renderInline(src [, env]) -> String
* - src (String): source string
* - env (Object): environment sandbox
*
* Similar to [[MarkdownIt.render]] but for single paragraph content. Result
* will NOT be wrapped into `` tags.
**/
MarkdownIt.prototype.renderInline = function (src, env) {
env = env || {};
return this.renderer.render(this.parseInline(src, env), this.options, env);
};
module.exports = MarkdownIt;
/***/ }),
/***/ "./node_modules/markdown-it/lib/parser_block.js":
/*!******************************************************!*\
!*** ./node_modules/markdown-it/lib/parser_block.js ***!
\******************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
/** internal
* class ParserBlock
*
* Block-level tokenizer.
**/
var Ruler = __webpack_require__(/*! ./ruler */ "./node_modules/markdown-it/lib/ruler.js");
var _rules = [
// First 2 params - rule name & source. Secondary array - list of rules,
// which can be terminated by this one.
[ 'table', __webpack_require__(/*! ./rules_block/table */ "./node_modules/markdown-it/lib/rules_block/table.js"), [ 'paragraph', 'reference' ] ],
[ 'code', __webpack_require__(/*! ./rules_block/code */ "./node_modules/markdown-it/lib/rules_block/code.js") ],
[ 'fence', __webpack_require__(/*! ./rules_block/fence */ "./node_modules/markdown-it/lib/rules_block/fence.js"), [ 'paragraph', 'reference', 'blockquote', 'list' ] ],
[ 'blockquote', __webpack_require__(/*! ./rules_block/blockquote */ "./node_modules/markdown-it/lib/rules_block/blockquote.js"), [ 'paragraph', 'reference', 'blockquote', 'list' ] ],
[ 'hr', __webpack_require__(/*! ./rules_block/hr */ "./node_modules/markdown-it/lib/rules_block/hr.js"), [ 'paragraph', 'reference', 'blockquote', 'list' ] ],
[ 'list', __webpack_require__(/*! ./rules_block/list */ "./node_modules/markdown-it/lib/rules_block/list.js"), [ 'paragraph', 'reference', 'blockquote' ] ],
[ 'reference', __webpack_require__(/*! ./rules_block/reference */ "./node_modules/markdown-it/lib/rules_block/reference.js") ],
[ 'html_block', __webpack_require__(/*! ./rules_block/html_block */ "./node_modules/markdown-it/lib/rules_block/html_block.js"), [ 'paragraph', 'reference', 'blockquote' ] ],
[ 'heading', __webpack_require__(/*! ./rules_block/heading */ "./node_modules/markdown-it/lib/rules_block/heading.js"), [ 'paragraph', 'reference', 'blockquote' ] ],
[ 'lheading', __webpack_require__(/*! ./rules_block/lheading */ "./node_modules/markdown-it/lib/rules_block/lheading.js") ],
[ 'paragraph', __webpack_require__(/*! ./rules_block/paragraph */ "./node_modules/markdown-it/lib/rules_block/paragraph.js") ]
];
/**
* new ParserBlock()
**/
function ParserBlock() {
/**
* ParserBlock#ruler -> Ruler
*
* [[Ruler]] instance. Keep configuration of block rules.
**/
this.ruler = new Ruler();
for (var i = 0; i < _rules.length; i++) {
this.ruler.push(_rules[i][0], _rules[i][1], { alt: (_rules[i][2] || []).slice() });
}
}
// Generate tokens for input range
//
ParserBlock.prototype.tokenize = function (state, startLine, endLine) {
var ok, i,
rules = this.ruler.getRules(''),
len = rules.length,
line = startLine,
hasEmptyLines = false,
maxNesting = state.md.options.maxNesting;
while (line < endLine) {
state.line = line = state.skipEmptyLines(line);
if (line >= endLine) { break; }
// Termination condition for nested calls.
// Nested calls currently used for blockquotes & lists
if (state.sCount[line] < state.blkIndent) { break; }
// If nesting level exceeded - skip tail to the end. That's not ordinary
// situation and we should not care about content.
if (state.level >= maxNesting) {
state.line = endLine;
break;
}
// Try all possible rules.
// On success, rule should:
//
// - update `state.line`
// - update `state.tokens`
// - return true
for (i = 0; i < len; i++) {
ok = rules[i](state, line, endLine, false);
if (ok) { break; }
}
// set state.tight if we had an empty line before current tag
// i.e. latest empty line should not count
state.tight = !hasEmptyLines;
// paragraph might "eat" one newline after it in nested lists
if (state.isEmpty(state.line - 1)) {
hasEmptyLines = true;
}
line = state.line;
if (line < endLine && state.isEmpty(line)) {
hasEmptyLines = true;
line++;
state.line = line;
}
}
};
/**
* ParserBlock.parse(str, md, env, outTokens)
*
* Process input string and push block tokens into `outTokens`
**/
ParserBlock.prototype.parse = function (src, md, env, outTokens) {
var state;
if (!src) { return; }
state = new this.State(src, md, env, outTokens);
this.tokenize(state, state.line, state.lineMax);
};
ParserBlock.prototype.State = __webpack_require__(/*! ./rules_block/state_block */ "./node_modules/markdown-it/lib/rules_block/state_block.js");
module.exports = ParserBlock;
/***/ }),
/***/ "./node_modules/markdown-it/lib/parser_core.js":
/*!*****************************************************!*\
!*** ./node_modules/markdown-it/lib/parser_core.js ***!
\*****************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
/** internal
* class Core
*
* Top-level rules executor. Glues block/inline parsers and does intermediate
* transformations.
**/
var Ruler = __webpack_require__(/*! ./ruler */ "./node_modules/markdown-it/lib/ruler.js");
var _rules = [
[ 'normalize', __webpack_require__(/*! ./rules_core/normalize */ "./node_modules/markdown-it/lib/rules_core/normalize.js") ],
[ 'block', __webpack_require__(/*! ./rules_core/block */ "./node_modules/markdown-it/lib/rules_core/block.js") ],
[ 'inline', __webpack_require__(/*! ./rules_core/inline */ "./node_modules/markdown-it/lib/rules_core/inline.js") ],
[ 'linkify', __webpack_require__(/*! ./rules_core/linkify */ "./node_modules/markdown-it/lib/rules_core/linkify.js") ],
[ 'replacements', __webpack_require__(/*! ./rules_core/replacements */ "./node_modules/markdown-it/lib/rules_core/replacements.js") ],
[ 'smartquotes', __webpack_require__(/*! ./rules_core/smartquotes */ "./node_modules/markdown-it/lib/rules_core/smartquotes.js") ]
];
/**
* new Core()
**/
function Core() {
/**
* Core#ruler -> Ruler
*
* [[Ruler]] instance. Keep configuration of core rules.
**/
this.ruler = new Ruler();
for (var i = 0; i < _rules.length; i++) {
this.ruler.push(_rules[i][0], _rules[i][1]);
}
}
/**
* Core.process(state)
*
* Executes core chain rules.
**/
Core.prototype.process = function (state) {
var i, l, rules;
rules = this.ruler.getRules('');
for (i = 0, l = rules.length; i < l; i++) {
rules[i](state);
}
};
Core.prototype.State = __webpack_require__(/*! ./rules_core/state_core */ "./node_modules/markdown-it/lib/rules_core/state_core.js");
module.exports = Core;
/***/ }),
/***/ "./node_modules/markdown-it/lib/parser_inline.js":
/*!*******************************************************!*\
!*** ./node_modules/markdown-it/lib/parser_inline.js ***!
\*******************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
/** internal
* class ParserInline
*
* Tokenizes paragraph content.
**/
var Ruler = __webpack_require__(/*! ./ruler */ "./node_modules/markdown-it/lib/ruler.js");
////////////////////////////////////////////////////////////////////////////////
// Parser rules
var _rules = [
[ 'text', __webpack_require__(/*! ./rules_inline/text */ "./node_modules/markdown-it/lib/rules_inline/text.js") ],
[ 'newline', __webpack_require__(/*! ./rules_inline/newline */ "./node_modules/markdown-it/lib/rules_inline/newline.js") ],
[ 'escape', __webpack_require__(/*! ./rules_inline/escape */ "./node_modules/markdown-it/lib/rules_inline/escape.js") ],
[ 'backticks', __webpack_require__(/*! ./rules_inline/backticks */ "./node_modules/markdown-it/lib/rules_inline/backticks.js") ],
[ 'strikethrough', __webpack_require__(/*! ./rules_inline/strikethrough */ "./node_modules/markdown-it/lib/rules_inline/strikethrough.js").tokenize ],
[ 'emphasis', __webpack_require__(/*! ./rules_inline/emphasis */ "./node_modules/markdown-it/lib/rules_inline/emphasis.js").tokenize ],
[ 'link', __webpack_require__(/*! ./rules_inline/link */ "./node_modules/markdown-it/lib/rules_inline/link.js") ],
[ 'image', __webpack_require__(/*! ./rules_inline/image */ "./node_modules/markdown-it/lib/rules_inline/image.js") ],
[ 'autolink', __webpack_require__(/*! ./rules_inline/autolink */ "./node_modules/markdown-it/lib/rules_inline/autolink.js") ],
[ 'html_inline', __webpack_require__(/*! ./rules_inline/html_inline */ "./node_modules/markdown-it/lib/rules_inline/html_inline.js") ],
[ 'entity', __webpack_require__(/*! ./rules_inline/entity */ "./node_modules/markdown-it/lib/rules_inline/entity.js") ]
];
var _rules2 = [
[ 'balance_pairs', __webpack_require__(/*! ./rules_inline/balance_pairs */ "./node_modules/markdown-it/lib/rules_inline/balance_pairs.js") ],
[ 'strikethrough', __webpack_require__(/*! ./rules_inline/strikethrough */ "./node_modules/markdown-it/lib/rules_inline/strikethrough.js").postProcess ],
[ 'emphasis', __webpack_require__(/*! ./rules_inline/emphasis */ "./node_modules/markdown-it/lib/rules_inline/emphasis.js").postProcess ],
[ 'text_collapse', __webpack_require__(/*! ./rules_inline/text_collapse */ "./node_modules/markdown-it/lib/rules_inline/text_collapse.js") ]
];
/**
* new ParserInline()
**/
function ParserInline() {
var i;
/**
* ParserInline#ruler -> Ruler
*
* [[Ruler]] instance. Keep configuration of inline rules.
**/
this.ruler = new Ruler();
for (i = 0; i < _rules.length; i++) {
this.ruler.push(_rules[i][0], _rules[i][1]);
}
/**
* ParserInline#ruler2 -> Ruler
*
* [[Ruler]] instance. Second ruler used for post-processing
* (e.g. in emphasis-like rules).
**/
this.ruler2 = new Ruler();
for (i = 0; i < _rules2.length; i++) {
this.ruler2.push(_rules2[i][0], _rules2[i][1]);
}
}
// Skip single token by running all rules in validation mode;
// returns `true` if any rule reported success
//
ParserInline.prototype.skipToken = function (state) {
var ok, i, pos = state.pos,
rules = this.ruler.getRules(''),
len = rules.length,
maxNesting = state.md.options.maxNesting,
cache = state.cache;
if (typeof cache[pos] !== 'undefined') {
state.pos = cache[pos];
return;
}
if (state.level < maxNesting) {
for (i = 0; i < len; i++) {
// Increment state.level and decrement it later to limit recursion.
// It's harmless to do here, because no tokens are created. But ideally,
// we'd need a separate private state variable for this purpose.
//
state.level++;
ok = rules[i](state, true);
state.level--;
if (ok) { break; }
}
} else {
// Too much nesting, just skip until the end of the paragraph.
//
// NOTE: this will cause links to behave incorrectly in the following case,
// when an amount of `[` is exactly equal to `maxNesting + 1`:
//
// [[[[[[[[[[[[[[[[[[[[[foo]()
//
// TODO: remove this workaround when CM standard will allow nested links
// (we can replace it by preventing links from being parsed in
// validation mode)
//
state.pos = state.posMax;
}
if (!ok) { state.pos++; }
cache[pos] = state.pos;
};
// Generate tokens for input range
//
ParserInline.prototype.tokenize = function (state) {
var ok, i,
rules = this.ruler.getRules(''),
len = rules.length,
end = state.posMax,
maxNesting = state.md.options.maxNesting;
while (state.pos < end) {
// Try all possible rules.
// On success, rule should:
//
// - update `state.pos`
// - update `state.tokens`
// - return true
if (state.level < maxNesting) {
for (i = 0; i < len; i++) {
ok = rules[i](state, false);
if (ok) { break; }
}
}
if (ok) {
if (state.pos >= end) { break; }
continue;
}
state.pending += state.src[state.pos++];
}
if (state.pending) {
state.pushPending();
}
};
/**
* ParserInline.parse(str, md, env, outTokens)
*
* Process input string and push inline tokens into `outTokens`
**/
ParserInline.prototype.parse = function (str, md, env, outTokens) {
var i, rules, len;
var state = new this.State(str, md, env, outTokens);
this.tokenize(state);
rules = this.ruler2.getRules('');
len = rules.length;
for (i = 0; i < len; i++) {
rules[i](state);
}
};
ParserInline.prototype.State = __webpack_require__(/*! ./rules_inline/state_inline */ "./node_modules/markdown-it/lib/rules_inline/state_inline.js");
module.exports = ParserInline;
/***/ }),
/***/ "./node_modules/markdown-it/lib/presets/commonmark.js":
/*!************************************************************!*\
!*** ./node_modules/markdown-it/lib/presets/commonmark.js ***!
\************************************************************/
/***/ ((module) => {
"use strict";
// Commonmark default options
module.exports = {
options: {
html: true, // Enable HTML tags in source
xhtmlOut: true, // Use '/' to close single tags (
)
breaks: false, // Convert '\n' in paragraphs into
langPrefix: 'language-', // CSS language prefix for fenced blocks
linkify: false, // autoconvert URL-like texts to links
// Enable some language-neutral replacements + quotes beautification
typographer: false,
// Double + single quotes replacement pairs, when typographer enabled,
// and smartquotes on. Could be either a String or an Array.
//
// For example, you can use '«»„“' for Russian, '„“‚‘' for German,
// and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
quotes: '\u201c\u201d\u2018\u2019', /* “”‘’ */
// Highlighter function. Should return escaped HTML,
// or '' if the source string is not changed and should be escaped externaly.
// If result starts with
{
"use strict";
// markdown-it default options
module.exports = {
options: {
html: false, // Enable HTML tags in source
xhtmlOut: false, // Use '/' to close single tags (
)
breaks: false, // Convert '\n' in paragraphs into
langPrefix: 'language-', // CSS language prefix for fenced blocks
linkify: false, // autoconvert URL-like texts to links
// Enable some language-neutral replacements + quotes beautification
typographer: false,
// Double + single quotes replacement pairs, when typographer enabled,
// and smartquotes on. Could be either a String or an Array.
//
// For example, you can use '«»„“' for Russian, '„“‚‘' for German,
// and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
quotes: '\u201c\u201d\u2018\u2019', /* “”‘’ */
// Highlighter function. Should return escaped HTML,
// or '' if the source string is not changed and should be escaped externaly.
// If result starts with {
"use strict";
// "Zero" preset, with nothing enabled. Useful for manual configuring of simple
// modes. For example, to parse bold/italic only.
module.exports = {
options: {
html: false, // Enable HTML tags in source
xhtmlOut: false, // Use '/' to close single tags (
)
breaks: false, // Convert '\n' in paragraphs into
langPrefix: 'language-', // CSS language prefix for fenced blocks
linkify: false, // autoconvert URL-like texts to links
// Enable some language-neutral replacements + quotes beautification
typographer: false,
// Double + single quotes replacement pairs, when typographer enabled,
// and smartquotes on. Could be either a String or an Array.
//
// For example, you can use '«»„“' for Russian, '„“‚‘' for German,
// and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
quotes: '\u201c\u201d\u2018\u2019', /* “”‘’ */
// Highlighter function. Should return escaped HTML,
// or '' if the source string is not changed and should be escaped externaly.
// If result starts with {
"use strict";
/**
* class Renderer
*
* Generates HTML from parsed token stream. Each instance has independent
* copy of rules. Those can be rewritten with ease. Also, you can add new
* rules if you create plugin and adds new token types.
**/
var assign = __webpack_require__(/*! ./common/utils */ "./node_modules/markdown-it/lib/common/utils.js").assign;
var unescapeAll = __webpack_require__(/*! ./common/utils */ "./node_modules/markdown-it/lib/common/utils.js").unescapeAll;
var escapeHtml = __webpack_require__(/*! ./common/utils */ "./node_modules/markdown-it/lib/common/utils.js").escapeHtml;
////////////////////////////////////////////////////////////////////////////////
var default_rules = {};
default_rules.code_inline = function (tokens, idx, options, env, slf) {
var token = tokens[idx];
return '' +
escapeHtml(tokens[idx].content) +
'';
};
default_rules.code_block = function (tokens, idx, options, env, slf) {
var token = tokens[idx];
return '' +
escapeHtml(tokens[idx].content) +
'
\n';
};
default_rules.fence = function (tokens, idx, options, env, slf) {
var token = tokens[idx],
info = token.info ? unescapeAll(token.info).trim() : '',
langName = '',
langAttrs = '',
highlighted, i, arr, tmpAttrs, tmpToken;
if (info) {
arr = info.split(/(\s+)/g);
langName = arr[0];
langAttrs = arr.slice(2).join('');
}
if (options.highlight) {
highlighted = options.highlight(token.content, langName, langAttrs) || escapeHtml(token.content);
} else {
highlighted = escapeHtml(token.content);
}
if (highlighted.indexOf(''
+ highlighted
+ '
\n';
}
return ''
+ highlighted
+ '
\n';
};
default_rules.image = function (tokens, idx, options, env, slf) {
var token = tokens[idx];
// "alt" attr MUST be set, even if empty. Because it's mandatory and
// should be placed on proper position for tests.
//
// Replace content with actual value
token.attrs[token.attrIndex('alt')][1] =
slf.renderInlineAsText(token.children, options, env);
return slf.renderToken(tokens, idx, options);
};
default_rules.hardbreak = function (tokens, idx, options /*, env */) {
return options.xhtmlOut ? '
\n' : '
\n';
};
default_rules.softbreak = function (tokens, idx, options /*, env */) {
return options.breaks ? (options.xhtmlOut ? '
\n' : '
\n') : '\n';
};
default_rules.text = function (tokens, idx /*, options, env */) {
return escapeHtml(tokens[idx].content);
};
default_rules.html_block = function (tokens, idx /*, options, env */) {
return tokens[idx].content;
};
default_rules.html_inline = function (tokens, idx /*, options, env */) {
return tokens[idx].content;
};
/**
* new Renderer()
*
* Creates new [[Renderer]] instance and fill [[Renderer#rules]] with defaults.
**/
function Renderer() {
/**
* Renderer#rules -> Object
*
* Contains render rules for tokens. Can be updated and extended.
*
* ##### Example
*
* ```javascript
* var md = require('markdown-it')();
*
* md.renderer.rules.strong_open = function () { return ''; };
* md.renderer.rules.strong_close = function () { return ''; };
*
* var result = md.renderInline(...);
* ```
*
* Each rule is called as independent static function with fixed signature:
*
* ```javascript
* function my_token_render(tokens, idx, options, env, renderer) {
* // ...
* return renderedHTML;
* }
* ```
*
* See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)
* for more details and examples.
**/
this.rules = assign({}, default_rules);
}
/**
* Renderer.renderAttrs(token) -> String
*
* Render token attributes to string.
**/
Renderer.prototype.renderAttrs = function renderAttrs(token) {
var i, l, result;
if (!token.attrs) { return ''; }
result = '';
for (i = 0, l = token.attrs.length; i < l; i++) {
result += ' ' + escapeHtml(token.attrs[i][0]) + '="' + escapeHtml(token.attrs[i][1]) + '"';
}
return result;
};
/**
* Renderer.renderToken(tokens, idx, options) -> String
* - tokens (Array): list of tokens
* - idx (Numbed): token index to render
* - options (Object): params of parser instance
*
* Default token renderer. Can be overriden by custom function
* in [[Renderer#rules]].
**/
Renderer.prototype.renderToken = function renderToken(tokens, idx, options) {
var nextToken,
result = '',
needLf = false,
token = tokens[idx];
// Tight list paragraphs
if (token.hidden) {
return '';
}
// Insert a newline between hidden paragraph and subsequent opening
// block-level tag.
//
// For example, here we should insert a newline before blockquote:
// - a
// >
//
if (token.block && token.nesting !== -1 && idx && tokens[idx - 1].hidden) {
result += '\n';
}
// Add token name, e.g. `
`.
//
needLf = false;
}
}
}
}
result += needLf ? '>\n' : '>';
return result;
};
/**
* Renderer.renderInline(tokens, options, env) -> String
* - tokens (Array): list on block tokens to renter
* - options (Object): params of parser instance
* - env (Object): additional data from parsed input (references, for example)
*
* The same as [[Renderer.render]], but for single token of `inline` type.
**/
Renderer.prototype.renderInline = function (tokens, options, env) {
var type,
result = '',
rules = this.rules;
for (var i = 0, len = tokens.length; i < len; i++) {
type = tokens[i].type;
if (typeof rules[type] !== 'undefined') {
result += rules[type](tokens, i, options, env, this);
} else {
result += this.renderToken(tokens, i, options);
}
}
return result;
};
/** internal
* Renderer.renderInlineAsText(tokens, options, env) -> String
* - tokens (Array): list on block tokens to renter
* - options (Object): params of parser instance
* - env (Object): additional data from parsed input (references, for example)
*
* Special kludge for image `alt` attributes to conform CommonMark spec.
* Don't try to use it! Spec requires to show `alt` content with stripped markup,
* instead of simple escaping.
**/
Renderer.prototype.renderInlineAsText = function (tokens, options, env) {
var result = '';
for (var i = 0, len = tokens.length; i < len; i++) {
if (tokens[i].type === 'text') {
result += tokens[i].content;
} else if (tokens[i].type === 'image') {
result += this.renderInlineAsText(tokens[i].children, options, env);
} else if (tokens[i].type === 'softbreak') {
result += '\n';
}
}
return result;
};
/**
* Renderer.render(tokens, options, env) -> String
* - tokens (Array): list on block tokens to renter
* - options (Object): params of parser instance
* - env (Object): additional data from parsed input (references, for example)
*
* Takes token stream and generates HTML. Probably, you will never need to call
* this method directly.
**/
Renderer.prototype.render = function (tokens, options, env) {
var i, len, type,
result = '',
rules = this.rules;
for (i = 0, len = tokens.length; i < len; i++) {
type = tokens[i].type;
if (type === 'inline') {
result += this.renderInline(tokens[i].children, options, env);
} else if (typeof rules[type] !== 'undefined') {
result += rules[tokens[i].type](tokens, i, options, env, this);
} else {
result += this.renderToken(tokens, i, options, env);
}
}
return result;
};
module.exports = Renderer;
/***/ }),
/***/ "./node_modules/markdown-it/lib/ruler.js":
/*!***********************************************!*\
!*** ./node_modules/markdown-it/lib/ruler.js ***!
\***********************************************/
/***/ ((module) => {
"use strict";
/**
* class Ruler
*
* Helper class, used by [[MarkdownIt#core]], [[MarkdownIt#block]] and
* [[MarkdownIt#inline]] to manage sequences of functions (rules):
*
* - keep rules in defined order
* - assign the name to each rule
* - enable/disable rules
* - add/replace rules
* - allow assign rules to additional named chains (in the same)
* - cacheing lists of active rules
*
* You will not need use this class directly until write plugins. For simple
* rules control use [[MarkdownIt.disable]], [[MarkdownIt.enable]] and
* [[MarkdownIt.use]].
**/
/**
* new Ruler()
**/
function Ruler() {
// List of added rules. Each element is:
//
// {
// name: XXX,
// enabled: Boolean,
// fn: Function(),
// alt: [ name2, name3 ]
// }
//
this.__rules__ = [];
// Cached rule chains.
//
// First level - chain name, '' for default.
// Second level - diginal anchor for fast filtering by charcodes.
//
this.__cache__ = null;
}
////////////////////////////////////////////////////////////////////////////////
// Helper methods, should not be used directly
// Find rule index by name
//
Ruler.prototype.__find__ = function (name) {
for (var i = 0; i < this.__rules__.length; i++) {
if (this.__rules__[i].name === name) {
return i;
}
}
return -1;
};
// Build rules lookup cache
//
Ruler.prototype.__compile__ = function () {
var self = this;
var chains = [ '' ];
// collect unique names
self.__rules__.forEach(function (rule) {
if (!rule.enabled) { return; }
rule.alt.forEach(function (altName) {
if (chains.indexOf(altName) < 0) {
chains.push(altName);
}
});
});
self.__cache__ = {};
chains.forEach(function (chain) {
self.__cache__[chain] = [];
self.__rules__.forEach(function (rule) {
if (!rule.enabled) { return; }
if (chain && rule.alt.indexOf(chain) < 0) { return; }
self.__cache__[chain].push(rule.fn);
});
});
};
/**
* Ruler.at(name, fn [, options])
* - name (String): rule name to replace.
* - fn (Function): new rule function.
* - options (Object): new rule options (not mandatory).
*
* Replace rule by name with new function & options. Throws error if name not
* found.
*
* ##### Options:
*
* - __alt__ - array with names of "alternate" chains.
*
* ##### Example
*
* Replace existing typographer replacement rule with new one:
*
* ```javascript
* var md = require('markdown-it')();
*
* md.core.ruler.at('replacements', function replace(state) {
* //...
* });
* ```
**/
Ruler.prototype.at = function (name, fn, options) {
var index = this.__find__(name);
var opt = options || {};
if (index === -1) { throw new Error('Parser rule not found: ' + name); }
this.__rules__[index].fn = fn;
this.__rules__[index].alt = opt.alt || [];
this.__cache__ = null;
};
/**
* Ruler.before(beforeName, ruleName, fn [, options])
* - beforeName (String): new rule will be added before this one.
* - ruleName (String): name of added rule.
* - fn (Function): rule function.
* - options (Object): rule options (not mandatory).
*
* Add new rule to chain before one with given name. See also
* [[Ruler.after]], [[Ruler.push]].
*
* ##### Options:
*
* - __alt__ - array with names of "alternate" chains.
*
* ##### Example
*
* ```javascript
* var md = require('markdown-it')();
*
* md.block.ruler.before('paragraph', 'my_rule', function replace(state) {
* //...
* });
* ```
**/
Ruler.prototype.before = function (beforeName, ruleName, fn, options) {
var index = this.__find__(beforeName);
var opt = options || {};
if (index === -1) { throw new Error('Parser rule not found: ' + beforeName); }
this.__rules__.splice(index, 0, {
name: ruleName,
enabled: true,
fn: fn,
alt: opt.alt || []
});
this.__cache__ = null;
};
/**
* Ruler.after(afterName, ruleName, fn [, options])
* - afterName (String): new rule will be added after this one.
* - ruleName (String): name of added rule.
* - fn (Function): rule function.
* - options (Object): rule options (not mandatory).
*
* Add new rule to chain after one with given name. See also
* [[Ruler.before]], [[Ruler.push]].
*
* ##### Options:
*
* - __alt__ - array with names of "alternate" chains.
*
* ##### Example
*
* ```javascript
* var md = require('markdown-it')();
*
* md.inline.ruler.after('text', 'my_rule', function replace(state) {
* //...
* });
* ```
**/
Ruler.prototype.after = function (afterName, ruleName, fn, options) {
var index = this.__find__(afterName);
var opt = options || {};
if (index === -1) { throw new Error('Parser rule not found: ' + afterName); }
this.__rules__.splice(index + 1, 0, {
name: ruleName,
enabled: true,
fn: fn,
alt: opt.alt || []
});
this.__cache__ = null;
};
/**
* Ruler.push(ruleName, fn [, options])
* - ruleName (String): name of added rule.
* - fn (Function): rule function.
* - options (Object): rule options (not mandatory).
*
* Push new rule to the end of chain. See also
* [[Ruler.before]], [[Ruler.after]].
*
* ##### Options:
*
* - __alt__ - array with names of "alternate" chains.
*
* ##### Example
*
* ```javascript
* var md = require('markdown-it')();
*
* md.core.ruler.push('my_rule', function replace(state) {
* //...
* });
* ```
**/
Ruler.prototype.push = function (ruleName, fn, options) {
var opt = options || {};
this.__rules__.push({
name: ruleName,
enabled: true,
fn: fn,
alt: opt.alt || []
});
this.__cache__ = null;
};
/**
* Ruler.enable(list [, ignoreInvalid]) -> Array
* - list (String|Array): list of rule names to enable.
* - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
*
* Enable rules with given names. If any rule name not found - throw Error.
* Errors can be disabled by second param.
*
* Returns list of found rule names (if no exception happened).
*
* See also [[Ruler.disable]], [[Ruler.enableOnly]].
**/
Ruler.prototype.enable = function (list, ignoreInvalid) {
if (!Array.isArray(list)) { list = [ list ]; }
var result = [];
// Search by name and enable
list.forEach(function (name) {
var idx = this.__find__(name);
if (idx < 0) {
if (ignoreInvalid) { return; }
throw new Error('Rules manager: invalid rule name ' + name);
}
this.__rules__[idx].enabled = true;
result.push(name);
}, this);
this.__cache__ = null;
return result;
};
/**
* Ruler.enableOnly(list [, ignoreInvalid])
* - list (String|Array): list of rule names to enable (whitelist).
* - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
*
* Enable rules with given names, and disable everything else. If any rule name
* not found - throw Error. Errors can be disabled by second param.
*
* See also [[Ruler.disable]], [[Ruler.enable]].
**/
Ruler.prototype.enableOnly = function (list, ignoreInvalid) {
if (!Array.isArray(list)) { list = [ list ]; }
this.__rules__.forEach(function (rule) { rule.enabled = false; });
this.enable(list, ignoreInvalid);
};
/**
* Ruler.disable(list [, ignoreInvalid]) -> Array
* - list (String|Array): list of rule names to disable.
* - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
*
* Disable rules with given names. If any rule name not found - throw Error.
* Errors can be disabled by second param.
*
* Returns list of found rule names (if no exception happened).
*
* See also [[Ruler.enable]], [[Ruler.enableOnly]].
**/
Ruler.prototype.disable = function (list, ignoreInvalid) {
if (!Array.isArray(list)) { list = [ list ]; }
var result = [];
// Search by name and disable
list.forEach(function (name) {
var idx = this.__find__(name);
if (idx < 0) {
if (ignoreInvalid) { return; }
throw new Error('Rules manager: invalid rule name ' + name);
}
this.__rules__[idx].enabled = false;
result.push(name);
}, this);
this.__cache__ = null;
return result;
};
/**
* Ruler.getRules(chainName) -> Array
*
* Return array of active functions (rules) for given chain name. It analyzes
* rules configuration, compiles caches if not exists and returns result.
*
* Default chain name is `''` (empty string). It can't be skipped. That's
* done intentionally, to keep signature monomorphic for high speed.
**/
Ruler.prototype.getRules = function (chainName) {
if (this.__cache__ === null) {
this.__compile__();
}
// Chain can be empty, if rules disabled. But we still have to return Array.
return this.__cache__[chainName] || [];
};
module.exports = Ruler;
/***/ }),
/***/ "./node_modules/markdown-it/lib/rules_block/blockquote.js":
/*!****************************************************************!*\
!*** ./node_modules/markdown-it/lib/rules_block/blockquote.js ***!
\****************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
// Block quotes
var isSpace = __webpack_require__(/*! ../common/utils */ "./node_modules/markdown-it/lib/common/utils.js").isSpace;
module.exports = function blockquote(state, startLine, endLine, silent) {
var adjustTab,
ch,
i,
initial,
l,
lastLineEmpty,
lines,
nextLine,
offset,
oldBMarks,
oldBSCount,
oldIndent,
oldParentType,
oldSCount,
oldTShift,
spaceAfterMarker,
terminate,
terminatorRules,
token,
isOutdented,
oldLineMax = state.lineMax,
pos = state.bMarks[startLine] + state.tShift[startLine],
max = state.eMarks[startLine];
// if it's indented more than 3 spaces, it should be a code block
if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
// check the block quote marker
if (state.src.charCodeAt(pos++) !== 0x3E/* > */) { return false; }
// we know that it's going to be a valid blockquote,
// so no point trying to find the end of it in silent mode
if (silent) { return true; }
// set offset past spaces and ">"
initial = offset = state.sCount[startLine] + 1;
// skip one optional space after '>'
if (state.src.charCodeAt(pos) === 0x20 /* space */) {
// ' > test '
// ^ -- position start of line here:
pos++;
initial++;
offset++;
adjustTab = false;
spaceAfterMarker = true;
} else if (state.src.charCodeAt(pos) === 0x09 /* tab */) {
spaceAfterMarker = true;
if ((state.bsCount[startLine] + offset) % 4 === 3) {
// ' >\t test '
// ^ -- position start of line here (tab has width===1)
pos++;
initial++;
offset++;
adjustTab = false;
} else {
// ' >\t test '
// ^ -- position start of line here + shift bsCount slightly
// to make extra space appear
adjustTab = true;
}
} else {
spaceAfterMarker = false;
}
oldBMarks = [ state.bMarks[startLine] ];
state.bMarks[startLine] = pos;
while (pos < max) {
ch = state.src.charCodeAt(pos);
if (isSpace(ch)) {
if (ch === 0x09) {
offset += 4 - (offset + state.bsCount[startLine] + (adjustTab ? 1 : 0)) % 4;
} else {
offset++;
}
} else {
break;
}
pos++;
}
oldBSCount = [ state.bsCount[startLine] ];
state.bsCount[startLine] = state.sCount[startLine] + 1 + (spaceAfterMarker ? 1 : 0);
lastLineEmpty = pos >= max;
oldSCount = [ state.sCount[startLine] ];
state.sCount[startLine] = offset - initial;
oldTShift = [ state.tShift[startLine] ];
state.tShift[startLine] = pos - state.bMarks[startLine];
terminatorRules = state.md.block.ruler.getRules('blockquote');
oldParentType = state.parentType;
state.parentType = 'blockquote';
// Search the end of the block
//
// Block ends with either:
// 1. an empty line outside:
// ```
// > test
//
// ```
// 2. an empty line inside:
// ```
// >
// test
// ```
// 3. another tag:
// ```
// > test
// - - -
// ```
for (nextLine = startLine + 1; nextLine < endLine; nextLine++) {
// check if it's outdented, i.e. it's inside list item and indented
// less than said list item:
//
// ```
// 1. anything
// > current blockquote
// 2. checking this line
// ```
isOutdented = state.sCount[nextLine] < state.blkIndent;
pos = state.bMarks[nextLine] + state.tShift[nextLine];
max = state.eMarks[nextLine];
if (pos >= max) {
// Case 1: line is not inside the blockquote, and this line is empty.
break;
}
if (state.src.charCodeAt(pos++) === 0x3E/* > */ && !isOutdented) {
// This line is inside the blockquote.
// set offset past spaces and ">"
initial = offset = state.sCount[nextLine] + 1;
// skip one optional space after '>'
if (state.src.charCodeAt(pos) === 0x20 /* space */) {
// ' > test '
// ^ -- position start of line here:
pos++;
initial++;
offset++;
adjustTab = false;
spaceAfterMarker = true;
} else if (state.src.charCodeAt(pos) === 0x09 /* tab */) {
spaceAfterMarker = true;
if ((state.bsCount[nextLine] + offset) % 4 === 3) {
// ' >\t test '
// ^ -- position start of line here (tab has width===1)
pos++;
initial++;
offset++;
adjustTab = false;
} else {
// ' >\t test '
// ^ -- position start of line here + shift bsCount slightly
// to make extra space appear
adjustTab = true;
}
} else {
spaceAfterMarker = false;
}
oldBMarks.push(state.bMarks[nextLine]);
state.bMarks[nextLine] = pos;
while (pos < max) {
ch = state.src.charCodeAt(pos);
if (isSpace(ch)) {
if (ch === 0x09) {
offset += 4 - (offset + state.bsCount[nextLine] + (adjustTab ? 1 : 0)) % 4;
} else {
offset++;
}
} else {
break;
}
pos++;
}
lastLineEmpty = pos >= max;
oldBSCount.push(state.bsCount[nextLine]);
state.bsCount[nextLine] = state.sCount[nextLine] + 1 + (spaceAfterMarker ? 1 : 0);
oldSCount.push(state.sCount[nextLine]);
state.sCount[nextLine] = offset - initial;
oldTShift.push(state.tShift[nextLine]);
state.tShift[nextLine] = pos - state.bMarks[nextLine];
continue;
}
// Case 2: line is not inside the blockquote, and the last line was empty.
if (lastLineEmpty) { break; }
// Case 3: another tag found.
terminate = false;
for (i = 0, l = terminatorRules.length; i < l; i++) {
if (terminatorRules[i](state, nextLine, endLine, true)) {
terminate = true;
break;
}
}
if (terminate) {
// Quirk to enforce "hard termination mode" for paragraphs;
// normally if you call `tokenize(state, startLine, nextLine)`,
// paragraphs will look below nextLine for paragraph continuation,
// but if blockquote is terminated by another tag, they shouldn't
state.lineMax = nextLine;
if (state.blkIndent !== 0) {
// state.blkIndent was non-zero, we now set it to zero,
// so we need to re-calculate all offsets to appear as
// if indent wasn't changed
oldBMarks.push(state.bMarks[nextLine]);
oldBSCount.push(state.bsCount[nextLine]);
oldTShift.push(state.tShift[nextLine]);
oldSCount.push(state.sCount[nextLine]);
state.sCount[nextLine] -= state.blkIndent;
}
break;
}
oldBMarks.push(state.bMarks[nextLine]);
oldBSCount.push(state.bsCount[nextLine]);
oldTShift.push(state.tShift[nextLine]);
oldSCount.push(state.sCount[nextLine]);
// A negative indentation means that this is a paragraph continuation
//
state.sCount[nextLine] = -1;
}
oldIndent = state.blkIndent;
state.blkIndent = 0;
token = state.push('blockquote_open', 'blockquote', 1);
token.markup = '>';
token.map = lines = [ startLine, 0 ];
state.md.block.tokenize(state, startLine, nextLine);
token = state.push('blockquote_close', 'blockquote', -1);
token.markup = '>';
state.lineMax = oldLineMax;
state.parentType = oldParentType;
lines[1] = state.line;
// Restore original tShift; this might not be necessary since the parser
// has already been here, but just to make sure we can do that.
for (i = 0; i < oldTShift.length; i++) {
state.bMarks[i + startLine] = oldBMarks[i];
state.tShift[i + startLine] = oldTShift[i];
state.sCount[i + startLine] = oldSCount[i];
state.bsCount[i + startLine] = oldBSCount[i];
}
state.blkIndent = oldIndent;
return true;
};
/***/ }),
/***/ "./node_modules/markdown-it/lib/rules_block/code.js":
/*!**********************************************************!*\
!*** ./node_modules/markdown-it/lib/rules_block/code.js ***!
\**********************************************************/
/***/ ((module) => {
"use strict";
// Code block (4 spaces padded)
module.exports = function code(state, startLine, endLine/*, silent*/) {
var nextLine, last, token;
if (state.sCount[startLine] - state.blkIndent < 4) { return false; }
last = nextLine = startLine + 1;
while (nextLine < endLine) {
if (state.isEmpty(nextLine)) {
nextLine++;
continue;
}
if (state.sCount[nextLine] - state.blkIndent >= 4) {
nextLine++;
last = nextLine;
continue;
}
break;
}
state.line = last;
token = state.push('code_block', 'code', 0);
token.content = state.getLines(startLine, last, 4 + state.blkIndent, false) + '\n';
token.map = [ startLine, state.line ];
return true;
};
/***/ }),
/***/ "./node_modules/markdown-it/lib/rules_block/fence.js":
/*!***********************************************************!*\
!*** ./node_modules/markdown-it/lib/rules_block/fence.js ***!
\***********************************************************/
/***/ ((module) => {
"use strict";
// fences (``` lang, ~~~ lang)
module.exports = function fence(state, startLine, endLine, silent) {
var marker, len, params, nextLine, mem, token, markup,
haveEndMarker = false,
pos = state.bMarks[startLine] + state.tShift[startLine],
max = state.eMarks[startLine];
// if it's indented more than 3 spaces, it should be a code block
if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
if (pos + 3 > max) { return false; }
marker = state.src.charCodeAt(pos);
if (marker !== 0x7E/* ~ */ && marker !== 0x60 /* ` */) {
return false;
}
// scan marker length
mem = pos;
pos = state.skipChars(pos, marker);
len = pos - mem;
if (len < 3) { return false; }
markup = state.src.slice(mem, pos);
params = state.src.slice(pos, max);
if (marker === 0x60 /* ` */) {
if (params.indexOf(String.fromCharCode(marker)) >= 0) {
return false;
}
}
// Since start is found, we can report success here in validation mode
if (silent) { return true; }
// search end of block
nextLine = startLine;
for (;;) {
nextLine++;
if (nextLine >= endLine) {
// unclosed block should be autoclosed by end of document.
// also block seems to be autoclosed by end of parent
break;
}
pos = mem = state.bMarks[nextLine] + state.tShift[nextLine];
max = state.eMarks[nextLine];
if (pos < max && state.sCount[nextLine] < state.blkIndent) {
// non-empty line with negative indent should stop the list:
// - ```
// test
break;
}
if (state.src.charCodeAt(pos) !== marker) { continue; }
if (state.sCount[nextLine] - state.blkIndent >= 4) {
// closing fence should be indented less than 4 spaces
continue;
}
pos = state.skipChars(pos, marker);
// closing code fence must be at least as long as the opening one
if (pos - mem < len) { continue; }
// make sure tail has spaces only
pos = state.skipSpaces(pos);
if (pos < max) { continue; }
haveEndMarker = true;
// found!
break;
}
// If a fence has heading spaces, they should be removed from its inner block
len = state.sCount[startLine];
state.line = nextLine + (haveEndMarker ? 1 : 0);
token = state.push('fence', 'code', 0);
token.info = params;
token.content = state.getLines(startLine + 1, nextLine, len, true);
token.markup = markup;
token.map = [ startLine, state.line ];
return true;
};
/***/ }),
/***/ "./node_modules/markdown-it/lib/rules_block/heading.js":
/*!*************************************************************!*\
!*** ./node_modules/markdown-it/lib/rules_block/heading.js ***!
\*************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
// heading (#, ##, ...)
var isSpace = __webpack_require__(/*! ../common/utils */ "./node_modules/markdown-it/lib/common/utils.js").isSpace;
module.exports = function heading(state, startLine, endLine, silent) {
var ch, level, tmp, token,
pos = state.bMarks[startLine] + state.tShift[startLine],
max = state.eMarks[startLine];
// if it's indented more than 3 spaces, it should be a code block
if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
ch = state.src.charCodeAt(pos);
if (ch !== 0x23/* # */ || pos >= max) { return false; }
// count heading level
level = 1;
ch = state.src.charCodeAt(++pos);
while (ch === 0x23/* # */ && pos < max && level <= 6) {
level++;
ch = state.src.charCodeAt(++pos);
}
if (level > 6 || (pos < max && !isSpace(ch))) { return false; }
if (silent) { return true; }
// Let's cut tails like ' ### ' from the end of string
max = state.skipSpacesBack(max, pos);
tmp = state.skipCharsBack(max, 0x23, pos); // #
if (tmp > pos && isSpace(state.src.charCodeAt(tmp - 1))) {
max = tmp;
}
state.line = startLine + 1;
token = state.push('heading_open', 'h' + String(level), 1);
token.markup = '########'.slice(0, level);
token.map = [ startLine, state.line ];
token = state.push('inline', '', 0);
token.content = state.src.slice(pos, max).trim();
token.map = [ startLine, state.line ];
token.children = [];
token = state.push('heading_close', 'h' + String(level), -1);
token.markup = '########'.slice(0, level);
return true;
};
/***/ }),
/***/ "./node_modules/markdown-it/lib/rules_block/hr.js":
/*!********************************************************!*\
!*** ./node_modules/markdown-it/lib/rules_block/hr.js ***!
\********************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
// Horizontal rule
var isSpace = __webpack_require__(/*! ../common/utils */ "./node_modules/markdown-it/lib/common/utils.js").isSpace;
module.exports = function hr(state, startLine, endLine, silent) {
var marker, cnt, ch, token,
pos = state.bMarks[startLine] + state.tShift[startLine],
max = state.eMarks[startLine];
// if it's indented more than 3 spaces, it should be a code block
if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
marker = state.src.charCodeAt(pos++);
// Check hr marker
if (marker !== 0x2A/* * */ &&
marker !== 0x2D/* - */ &&
marker !== 0x5F/* _ */) {
return false;
}
// markers can be mixed with spaces, but there should be at least 3 of them
cnt = 1;
while (pos < max) {
ch = state.src.charCodeAt(pos++);
if (ch !== marker && !isSpace(ch)) { return false; }
if (ch === marker) { cnt++; }
}
if (cnt < 3) { return false; }
if (silent) { return true; }
state.line = startLine + 1;
token = state.push('hr', 'hr', 0);
token.map = [ startLine, state.line ];
token.markup = Array(cnt + 1).join(String.fromCharCode(marker));
return true;
};
/***/ }),
/***/ "./node_modules/markdown-it/lib/rules_block/html_block.js":
/*!****************************************************************!*\
!*** ./node_modules/markdown-it/lib/rules_block/html_block.js ***!
\****************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
// HTML block
var block_names = __webpack_require__(/*! ../common/html_blocks */ "./node_modules/markdown-it/lib/common/html_blocks.js");
var HTML_OPEN_CLOSE_TAG_RE = __webpack_require__(/*! ../common/html_re */ "./node_modules/markdown-it/lib/common/html_re.js").HTML_OPEN_CLOSE_TAG_RE;
// An array of opening and corresponding closing sequences for html tags,
// last argument defines whether it can terminate a paragraph or not
//
var HTML_SEQUENCES = [
[ /^<(script|pre|style|textarea)(?=(\s|>|$))/i, /<\/(script|pre|style|textarea)>/i, true ],
[ /^/, true ],
[ /^<\?/, /\?>/, true ],
[ /^/, true ],
[ /^/, true ],
[ new RegExp('^?(' + block_names.join('|') + ')(?=(\\s|/?>|$))', 'i'), /^$/, true ],
[ new RegExp(HTML_OPEN_CLOSE_TAG_RE.source + '\\s*$'), /^$/, false ]
];
module.exports = function html_block(state, startLine, endLine, silent) {
var i, nextLine, token, lineText,
pos = state.bMarks[startLine] + state.tShift[startLine],
max = state.eMarks[startLine];
// if it's indented more than 3 spaces, it should be a code block
if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
if (!state.md.options.html) { return false; }
if (state.src.charCodeAt(pos) !== 0x3C/* < */) { return false; }
lineText = state.src.slice(pos, max);
for (i = 0; i < HTML_SEQUENCES.length; i++) {
if (HTML_SEQUENCES[i][0].test(lineText)) { break; }
}
if (i === HTML_SEQUENCES.length) { return false; }
if (silent) {
// true if this sequence can be a terminator, false otherwise
return HTML_SEQUENCES[i][2];
}
nextLine = startLine + 1;
// If we are here - we detected HTML block.
// Let's roll down till block end.
if (!HTML_SEQUENCES[i][1].test(lineText)) {
for (; nextLine < endLine; nextLine++) {
if (state.sCount[nextLine] < state.blkIndent) { break; }
pos = state.bMarks[nextLine] + state.tShift[nextLine];
max = state.eMarks[nextLine];
lineText = state.src.slice(pos, max);
if (HTML_SEQUENCES[i][1].test(lineText)) {
if (lineText.length !== 0) { nextLine++; }
break;
}
}
}
state.line = nextLine;
token = state.push('html_block', '', 0);
token.map = [ startLine, nextLine ];
token.content = state.getLines(startLine, nextLine, state.blkIndent, true);
return true;
};
/***/ }),
/***/ "./node_modules/markdown-it/lib/rules_block/lheading.js":
/*!**************************************************************!*\
!*** ./node_modules/markdown-it/lib/rules_block/lheading.js ***!
\**************************************************************/
/***/ ((module) => {
"use strict";
// lheading (---, ===)
module.exports = function lheading(state, startLine, endLine/*, silent*/) {
var content, terminate, i, l, token, pos, max, level, marker,
nextLine = startLine + 1, oldParentType,
terminatorRules = state.md.block.ruler.getRules('paragraph');
// if it's indented more than 3 spaces, it should be a code block
if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
oldParentType = state.parentType;
state.parentType = 'paragraph'; // use paragraph to match terminatorRules
// jump line-by-line until empty one or EOF
for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
// this would be a code block normally, but after paragraph
// it's considered a lazy continuation regardless of what's there
if (state.sCount[nextLine] - state.blkIndent > 3) { continue; }
//
// Check for underline in setext header
//
if (state.sCount[nextLine] >= state.blkIndent) {
pos = state.bMarks[nextLine] + state.tShift[nextLine];
max = state.eMarks[nextLine];
if (pos < max) {
marker = state.src.charCodeAt(pos);
if (marker === 0x2D/* - */ || marker === 0x3D/* = */) {
pos = state.skipChars(pos, marker);
pos = state.skipSpaces(pos);
if (pos >= max) {
level = (marker === 0x3D/* = */ ? 1 : 2);
break;
}
}
}
}
// quirk for blockquotes, this line should already be checked by that rule
if (state.sCount[nextLine] < 0) { continue; }
// Some tags can terminate paragraph without empty line.
terminate = false;
for (i = 0, l = terminatorRules.length; i < l; i++) {
if (terminatorRules[i](state, nextLine, endLine, true)) {
terminate = true;
break;
}
}
if (terminate) { break; }
}
if (!level) {
// Didn't find valid underline
return false;
}
content = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
state.line = nextLine + 1;
token = state.push('heading_open', 'h' + String(level), 1);
token.markup = String.fromCharCode(marker);
token.map = [ startLine, state.line ];
token = state.push('inline', '', 0);
token.content = content;
token.map = [ startLine, state.line - 1 ];
token.children = [];
token = state.push('heading_close', 'h' + String(level), -1);
token.markup = String.fromCharCode(marker);
state.parentType = oldParentType;
return true;
};
/***/ }),
/***/ "./node_modules/markdown-it/lib/rules_block/list.js":
/*!**********************************************************!*\
!*** ./node_modules/markdown-it/lib/rules_block/list.js ***!
\**********************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
// Lists
var isSpace = __webpack_require__(/*! ../common/utils */ "./node_modules/markdown-it/lib/common/utils.js").isSpace;
// Search `[-+*][\n ]`, returns next pos after marker on success
// or -1 on fail.
function skipBulletListMarker(state, startLine) {
var marker, pos, max, ch;
pos = state.bMarks[startLine] + state.tShift[startLine];
max = state.eMarks[startLine];
marker = state.src.charCodeAt(pos++);
// Check bullet
if (marker !== 0x2A/* * */ &&
marker !== 0x2D/* - */ &&
marker !== 0x2B/* + */) {
return -1;
}
if (pos < max) {
ch = state.src.charCodeAt(pos);
if (!isSpace(ch)) {
// " -test " - is not a list item
return -1;
}
}
return pos;
}
// Search `\d+[.)][\n ]`, returns next pos after marker on success
// or -1 on fail.
function skipOrderedListMarker(state, startLine) {
var ch,
start = state.bMarks[startLine] + state.tShift[startLine],
pos = start,
max = state.eMarks[startLine];
// List marker should have at least 2 chars (digit + dot)
if (pos + 1 >= max) { return -1; }
ch = state.src.charCodeAt(pos++);
if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }
for (;;) {
// EOL -> fail
if (pos >= max) { return -1; }
ch = state.src.charCodeAt(pos++);
if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {
// List marker should have no more than 9 digits
// (prevents integer overflow in browsers)
if (pos - start >= 10) { return -1; }
continue;
}
// found valid marker
if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {
break;
}
return -1;
}
if (pos < max) {
ch = state.src.charCodeAt(pos);
if (!isSpace(ch)) {
// " 1.test " - is not a list item
return -1;
}
}
return pos;
}
function markTightParagraphs(state, idx) {
var i, l,
level = state.level + 2;
for (i = idx + 2, l = state.tokens.length - 2; i < l; i++) {
if (state.tokens[i].level === level && state.tokens[i].type === 'paragraph_open') {
state.tokens[i + 2].hidden = true;
state.tokens[i].hidden = true;
i += 2;
}
}
}
module.exports = function list(state, startLine, endLine, silent) {
var ch,
contentStart,
i,
indent,
indentAfterMarker,
initial,
isOrdered,
itemLines,
l,
listLines,
listTokIdx,
markerCharCode,
markerValue,
max,
nextLine,
offset,
oldListIndent,
oldParentType,
oldSCount,
oldTShift,
oldTight,
pos,
posAfterMarker,
prevEmptyEnd,
start,
terminate,
terminatorRules,
token,
isTerminatingParagraph = false,
tight = true;
// if it's indented more than 3 spaces, it should be a code block
if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
// Special case:
// - item 1
// - item 2
// - item 3
// - item 4
// - this one is a paragraph continuation
if (state.listIndent >= 0 &&
state.sCount[startLine] - state.listIndent >= 4 &&
state.sCount[startLine] < state.blkIndent) {
return false;
}
// limit conditions when list can interrupt
// a paragraph (validation mode only)
if (silent && state.parentType === 'paragraph') {
// Next list item should still terminate previous list item;
//
// This code can fail if plugins use blkIndent as well as lists,
// but I hope the spec gets fixed long before that happens.
//
if (state.tShift[startLine] >= state.blkIndent) {
isTerminatingParagraph = true;
}
}
// Detect list type and position after marker
if ((posAfterMarker = skipOrderedListMarker(state, startLine)) >= 0) {
isOrdered = true;
start = state.bMarks[startLine] + state.tShift[startLine];
markerValue = Number(state.src.slice(start, posAfterMarker - 1));
// If we're starting a new ordered list right after
// a paragraph, it should start with 1.
if (isTerminatingParagraph && markerValue !== 1) return false;
} else if ((posAfterMarker = skipBulletListMarker(state, startLine)) >= 0) {
isOrdered = false;
} else {
return false;
}
// If we're starting a new unordered list right after
// a paragraph, first line should not be empty.
if (isTerminatingParagraph) {
if (state.skipSpaces(posAfterMarker) >= state.eMarks[startLine]) return false;
}
// We should terminate list on style change. Remember first one to compare.
markerCharCode = state.src.charCodeAt(posAfterMarker - 1);
// For validation mode we can terminate immediately
if (silent) { return true; }
// Start list
listTokIdx = state.tokens.length;
if (isOrdered) {
token = state.push('ordered_list_open', 'ol', 1);
if (markerValue !== 1) {
token.attrs = [ [ 'start', markerValue ] ];
}
} else {
token = state.push('bullet_list_open', 'ul', 1);
}
token.map = listLines = [ startLine, 0 ];
token.markup = String.fromCharCode(markerCharCode);
//
// Iterate list items
//
nextLine = startLine;
prevEmptyEnd = false;
terminatorRules = state.md.block.ruler.getRules('list');
oldParentType = state.parentType;
state.parentType = 'list';
while (nextLine < endLine) {
pos = posAfterMarker;
max = state.eMarks[nextLine];
initial = offset = state.sCount[nextLine] + posAfterMarker - (state.bMarks[startLine] + state.tShift[startLine]);
while (pos < max) {
ch = state.src.charCodeAt(pos);
if (ch === 0x09) {
offset += 4 - (offset + state.bsCount[nextLine]) % 4;
} else if (ch === 0x20) {
offset++;
} else {
break;
}
pos++;
}
contentStart = pos;
if (contentStart >= max) {
// trimming space in "- \n 3" case, indent is 1 here
indentAfterMarker = 1;
} else {
indentAfterMarker = offset - initial;
}
// If we have more than 4 spaces, the indent is 1
// (the rest is just indented code block)
if (indentAfterMarker > 4) { indentAfterMarker = 1; }
// " - test"
// ^^^^^ - calculating total length of this thing
indent = initial + indentAfterMarker;
// Run subparser & write tokens
token = state.push('list_item_open', 'li', 1);
token.markup = String.fromCharCode(markerCharCode);
token.map = itemLines = [ startLine, 0 ];
if (isOrdered) {
token.info = state.src.slice(start, posAfterMarker - 1);
}
// change current state, then restore it after parser subcall
oldTight = state.tight;
oldTShift = state.tShift[startLine];
oldSCount = state.sCount[startLine];
// - example list
// ^ listIndent position will be here
// ^ blkIndent position will be here
//
oldListIndent = state.listIndent;
state.listIndent = state.blkIndent;
state.blkIndent = indent;
state.tight = true;
state.tShift[startLine] = contentStart - state.bMarks[startLine];
state.sCount[startLine] = offset;
if (contentStart >= max && state.isEmpty(startLine + 1)) {
// workaround for this case
// (list item is empty, list terminates before "foo"):
// ~~~~~~~~
// -
//
// foo
// ~~~~~~~~
state.line = Math.min(state.line + 2, endLine);
} else {
state.md.block.tokenize(state, startLine, endLine, true);
}
// If any of list item is tight, mark list as tight
if (!state.tight || prevEmptyEnd) {
tight = false;
}
// Item become loose if finish with empty line,
// but we should filter last element, because it means list finish
prevEmptyEnd = (state.line - startLine) > 1 && state.isEmpty(state.line - 1);
state.blkIndent = state.listIndent;
state.listIndent = oldListIndent;
state.tShift[startLine] = oldTShift;
state.sCount[startLine] = oldSCount;
state.tight = oldTight;
token = state.push('list_item_close', 'li', -1);
token.markup = String.fromCharCode(markerCharCode);
nextLine = startLine = state.line;
itemLines[1] = nextLine;
contentStart = state.bMarks[startLine];
if (nextLine >= endLine) { break; }
//
// Try to check if list is terminated or continued.
//
if (state.sCount[nextLine] < state.blkIndent) { break; }
// if it's indented more than 3 spaces, it should be a code block
if (state.sCount[startLine] - state.blkIndent >= 4) { break; }
// fail if terminating block found
terminate = false;
for (i = 0, l = terminatorRules.length; i < l; i++) {
if (terminatorRules[i](state, nextLine, endLine, true)) {
terminate = true;
break;
}
}
if (terminate) { break; }
// fail if list has another type
if (isOrdered) {
posAfterMarker = skipOrderedListMarker(state, nextLine);
if (posAfterMarker < 0) { break; }
start = state.bMarks[nextLine] + state.tShift[nextLine];
} else {
posAfterMarker = skipBulletListMarker(state, nextLine);
if (posAfterMarker < 0) { break; }
}
if (markerCharCode !== state.src.charCodeAt(posAfterMarker - 1)) { break; }
}
// Finalize list
if (isOrdered) {
token = state.push('ordered_list_close', 'ol', -1);
} else {
token = state.push('bullet_list_close', 'ul', -1);
}
token.markup = String.fromCharCode(markerCharCode);
listLines[1] = nextLine;
state.line = nextLine;
state.parentType = oldParentType;
// mark paragraphs tight if needed
if (tight) {
markTightParagraphs(state, listTokIdx);
}
return true;
};
/***/ }),
/***/ "./node_modules/markdown-it/lib/rules_block/paragraph.js":
/*!***************************************************************!*\
!*** ./node_modules/markdown-it/lib/rules_block/paragraph.js ***!
\***************************************************************/
/***/ ((module) => {
"use strict";
// Paragraph
module.exports = function paragraph(state, startLine/*, endLine*/) {
var content, terminate, i, l, token, oldParentType,
nextLine = startLine + 1,
terminatorRules = state.md.block.ruler.getRules('paragraph'),
endLine = state.lineMax;
oldParentType = state.parentType;
state.parentType = 'paragraph';
// jump line-by-line until empty one or EOF
for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
// this would be a code block normally, but after paragraph
// it's considered a lazy continuation regardless of what's there
if (state.sCount[nextLine] - state.blkIndent > 3) { continue; }
// quirk for blockquotes, this line should already be checked by that rule
if (state.sCount[nextLine] < 0) { continue; }
// Some tags can terminate paragraph without empty line.
terminate = false;
for (i = 0, l = terminatorRules.length; i < l; i++) {
if (terminatorRules[i](state, nextLine, endLine, true)) {
terminate = true;
break;
}
}
if (terminate) { break; }
}
content = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
state.line = nextLine;
token = state.push('paragraph_open', 'p', 1);
token.map = [ startLine, state.line ];
token = state.push('inline', '', 0);
token.content = content;
token.map = [ startLine, state.line ];
token.children = [];
token = state.push('paragraph_close', 'p', -1);
state.parentType = oldParentType;
return true;
};
/***/ }),
/***/ "./node_modules/markdown-it/lib/rules_block/reference.js":
/*!***************************************************************!*\
!*** ./node_modules/markdown-it/lib/rules_block/reference.js ***!
\***************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
var normalizeReference = __webpack_require__(/*! ../common/utils */ "./node_modules/markdown-it/lib/common/utils.js").normalizeReference;
var isSpace = __webpack_require__(/*! ../common/utils */ "./node_modules/markdown-it/lib/common/utils.js").isSpace;
module.exports = function reference(state, startLine, _endLine, silent) {
var ch,
destEndPos,
destEndLineNo,
endLine,
href,
i,
l,
label,
labelEnd,
oldParentType,
res,
start,
str,
terminate,
terminatorRules,
title,
lines = 0,
pos = state.bMarks[startLine] + state.tShift[startLine],
max = state.eMarks[startLine],
nextLine = startLine + 1;
// if it's indented more than 3 spaces, it should be a code block
if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
if (state.src.charCodeAt(pos) !== 0x5B/* [ */) { return false; }
// Simple check to quickly interrupt scan on [link](url) at the start of line.
// Can be useful on practice: https://github.com/markdown-it/markdown-it/issues/54
while (++pos < max) {
if (state.src.charCodeAt(pos) === 0x5D /* ] */ &&
state.src.charCodeAt(pos - 1) !== 0x5C/* \ */) {
if (pos + 1 === max) { return false; }
if (state.src.charCodeAt(pos + 1) !== 0x3A/* : */) { return false; }
break;
}
}
endLine = state.lineMax;
// jump line-by-line until empty one or EOF
terminatorRules = state.md.block.ruler.getRules('reference');
oldParentType = state.parentType;
state.parentType = 'reference';
for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
// this would be a code block normally, but after paragraph
// it's considered a lazy continuation regardless of what's there
if (state.sCount[nextLine] - state.blkIndent > 3) { continue; }
// quirk for blockquotes, this line should already be checked by that rule
if (state.sCount[nextLine] < 0) { continue; }
// Some tags can terminate paragraph without empty line.
terminate = false;
for (i = 0, l = terminatorRules.length; i < l; i++) {
if (terminatorRules[i](state, nextLine, endLine, true)) {
terminate = true;
break;
}
}
if (terminate) { break; }
}
str = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
max = str.length;
for (pos = 1; pos < max; pos++) {
ch = str.charCodeAt(pos);
if (ch === 0x5B /* [ */) {
return false;
} else if (ch === 0x5D /* ] */) {
labelEnd = pos;
break;
} else if (ch === 0x0A /* \n */) {
lines++;
} else if (ch === 0x5C /* \ */) {
pos++;
if (pos < max && str.charCodeAt(pos) === 0x0A) {
lines++;
}
}
}
if (labelEnd < 0 || str.charCodeAt(labelEnd + 1) !== 0x3A/* : */) { return false; }
// [label]: destination 'title'
// ^^^ skip optional whitespace here
for (pos = labelEnd + 2; pos < max; pos++) {
ch = str.charCodeAt(pos);
if (ch === 0x0A) {
lines++;
} else if (isSpace(ch)) {
/*eslint no-empty:0*/
} else {
break;
}
}
// [label]: destination 'title'
// ^^^^^^^^^^^ parse this
res = state.md.helpers.parseLinkDestination(str, pos, max);
if (!res.ok) { return false; }
href = state.md.normalizeLink(res.str);
if (!state.md.validateLink(href)) { return false; }
pos = res.pos;
lines += res.lines;
// save cursor state, we could require to rollback later
destEndPos = pos;
destEndLineNo = lines;
// [label]: destination 'title'
// ^^^ skipping those spaces
start = pos;
for (; pos < max; pos++) {
ch = str.charCodeAt(pos);
if (ch === 0x0A) {
lines++;
} else if (isSpace(ch)) {
/*eslint no-empty:0*/
} else {
break;
}
}
// [label]: destination 'title'
// ^^^^^^^ parse this
res = state.md.helpers.parseLinkTitle(str, pos, max);
if (pos < max && start !== pos && res.ok) {
title = res.str;
pos = res.pos;
lines += res.lines;
} else {
title = '';
pos = destEndPos;
lines = destEndLineNo;
}
// skip trailing spaces until the rest of the line
while (pos < max) {
ch = str.charCodeAt(pos);
if (!isSpace(ch)) { break; }
pos++;
}
if (pos < max && str.charCodeAt(pos) !== 0x0A) {
if (title) {
// garbage at the end of the line after title,
// but it could still be a valid reference if we roll back
title = '';
pos = destEndPos;
lines = destEndLineNo;
while (pos < max) {
ch = str.charCodeAt(pos);
if (!isSpace(ch)) { break; }
pos++;
}
}
}
if (pos < max && str.charCodeAt(pos) !== 0x0A) {
// garbage at the end of the line
return false;
}
label = normalizeReference(str.slice(1, labelEnd));
if (!label) {
// CommonMark 0.20 disallows empty labels
return false;
}
// Reference can not terminate anything. This check is for safety only.
/*istanbul ignore if*/
if (silent) { return true; }
if (typeof state.env.references === 'undefined') {
state.env.references = {};
}
if (typeof state.env.references[label] === 'undefined') {
state.env.references[label] = { title: title, href: href };
}
state.parentType = oldParentType;
state.line = startLine + lines + 1;
return true;
};
/***/ }),
/***/ "./node_modules/markdown-it/lib/rules_block/state_block.js":
/*!*****************************************************************!*\
!*** ./node_modules/markdown-it/lib/rules_block/state_block.js ***!
\*****************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
// Parser state class
var Token = __webpack_require__(/*! ../token */ "./node_modules/markdown-it/lib/token.js");
var isSpace = __webpack_require__(/*! ../common/utils */ "./node_modules/markdown-it/lib/common/utils.js").isSpace;
function StateBlock(src, md, env, tokens) {
var ch, s, start, pos, len, indent, offset, indent_found;
this.src = src;
// link to parser instance
this.md = md;
this.env = env;
//
// Internal state vartiables
//
this.tokens = tokens;
this.bMarks = []; // line begin offsets for fast jumps
this.eMarks = []; // line end offsets for fast jumps
this.tShift = []; // offsets of the first non-space characters (tabs not expanded)
this.sCount = []; // indents for each line (tabs expanded)
// An amount of virtual spaces (tabs expanded) between beginning
// of each line (bMarks) and real beginning of that line.
//
// It exists only as a hack because blockquotes override bMarks
// losing information in the process.
//
// It's used only when expanding tabs, you can think about it as
// an initial tab length, e.g. bsCount=21 applied to string `\t123`
// means first tab should be expanded to 4-21%4 === 3 spaces.
//
this.bsCount = [];
// block parser variables
this.blkIndent = 0; // required block content indent (for example, if we are
// inside a list, it would be positioned after list marker)
this.line = 0; // line index in src
this.lineMax = 0; // lines count
this.tight = false; // loose/tight mode for lists
this.ddIndent = -1; // indent of the current dd block (-1 if there isn't any)
this.listIndent = -1; // indent of the current list block (-1 if there isn't any)
// can be 'blockquote', 'list', 'root', 'paragraph' or 'reference'
// used in lists to determine if they interrupt a paragraph
this.parentType = 'root';
this.level = 0;
// renderer
this.result = '';
// Create caches
// Generate markers.
s = this.src;
indent_found = false;
for (start = pos = indent = offset = 0, len = s.length; pos < len; pos++) {
ch = s.charCodeAt(pos);
if (!indent_found) {
if (isSpace(ch)) {
indent++;
if (ch === 0x09) {
offset += 4 - offset % 4;
} else {
offset++;
}
continue;
} else {
indent_found = true;
}
}
if (ch === 0x0A || pos === len - 1) {
if (ch !== 0x0A) { pos++; }
this.bMarks.push(start);
this.eMarks.push(pos);
this.tShift.push(indent);
this.sCount.push(offset);
this.bsCount.push(0);
indent_found = false;
indent = 0;
offset = 0;
start = pos + 1;
}
}
// Push fake entry to simplify cache bounds checks
this.bMarks.push(s.length);
this.eMarks.push(s.length);
this.tShift.push(0);
this.sCount.push(0);
this.bsCount.push(0);
this.lineMax = this.bMarks.length - 1; // don't count last fake line
}
// Push new token to "stream".
//
StateBlock.prototype.push = function (type, tag, nesting) {
var token = new Token(type, tag, nesting);
token.block = true;
if (nesting < 0) this.level--; // closing tag
token.level = this.level;
if (nesting > 0) this.level++; // opening tag
this.tokens.push(token);
return token;
};
StateBlock.prototype.isEmpty = function isEmpty(line) {
return this.bMarks[line] + this.tShift[line] >= this.eMarks[line];
};
StateBlock.prototype.skipEmptyLines = function skipEmptyLines(from) {
for (var max = this.lineMax; from < max; from++) {
if (this.bMarks[from] + this.tShift[from] < this.eMarks[from]) {
break;
}
}
return from;
};
// Skip spaces from given position.
StateBlock.prototype.skipSpaces = function skipSpaces(pos) {
var ch;
for (var max = this.src.length; pos < max; pos++) {
ch = this.src.charCodeAt(pos);
if (!isSpace(ch)) { break; }
}
return pos;
};
// Skip spaces from given position in reverse.
StateBlock.prototype.skipSpacesBack = function skipSpacesBack(pos, min) {
if (pos <= min) { return pos; }
while (pos > min) {
if (!isSpace(this.src.charCodeAt(--pos))) { return pos + 1; }
}
return pos;
};
// Skip char codes from given position
StateBlock.prototype.skipChars = function skipChars(pos, code) {
for (var max = this.src.length; pos < max; pos++) {
if (this.src.charCodeAt(pos) !== code) { break; }
}
return pos;
};
// Skip char codes reverse from given position - 1
StateBlock.prototype.skipCharsBack = function skipCharsBack(pos, code, min) {
if (pos <= min) { return pos; }
while (pos > min) {
if (code !== this.src.charCodeAt(--pos)) { return pos + 1; }
}
return pos;
};
// cut lines range from source.
StateBlock.prototype.getLines = function getLines(begin, end, indent, keepLastLF) {
var i, lineIndent, ch, first, last, queue, lineStart,
line = begin;
if (begin >= end) {
return '';
}
queue = new Array(end - begin);
for (i = 0; line < end; line++, i++) {
lineIndent = 0;
lineStart = first = this.bMarks[line];
if (line + 1 < end || keepLastLF) {
// No need for bounds check because we have fake entry on tail.
last = this.eMarks[line] + 1;
} else {
last = this.eMarks[line];
}
while (first < last && lineIndent < indent) {
ch = this.src.charCodeAt(first);
if (isSpace(ch)) {
if (ch === 0x09) {
lineIndent += 4 - (lineIndent + this.bsCount[line]) % 4;
} else {
lineIndent++;
}
} else if (first - lineStart < this.tShift[line]) {
// patched tShift masked characters to look like spaces (blockquotes, list markers)
lineIndent++;
} else {
break;
}
first++;
}
if (lineIndent > indent) {
// partially expanding tabs in code blocks, e.g '\t\tfoobar'
// with indent=2 becomes ' \tfoobar'
queue[i] = new Array(lineIndent - indent + 1).join(' ') + this.src.slice(first, last);
} else {
queue[i] = this.src.slice(first, last);
}
}
return queue.join('');
};
// re-export Token class to use in block rules
StateBlock.prototype.Token = Token;
module.exports = StateBlock;
/***/ }),
/***/ "./node_modules/markdown-it/lib/rules_block/table.js":
/*!***********************************************************!*\
!*** ./node_modules/markdown-it/lib/rules_block/table.js ***!
\***********************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
// GFM table, https://github.github.com/gfm/#tables-extension-
var isSpace = __webpack_require__(/*! ../common/utils */ "./node_modules/markdown-it/lib/common/utils.js").isSpace;
function getLine(state, line) {
var pos = state.bMarks[line] + state.tShift[line],
max = state.eMarks[line];
return state.src.substr(pos, max - pos);
}
function escapedSplit(str) {
var result = [],
pos = 0,
max = str.length,
ch,
isEscaped = false,
lastPos = 0,
current = '';
ch = str.charCodeAt(pos);
while (pos < max) {
if (ch === 0x7c/* | */) {
if (!isEscaped) {
// pipe separating cells, '|'
result.push(current + str.substring(lastPos, pos));
current = '';
lastPos = pos + 1;
} else {
// escaped pipe, '\|'
current += str.substring(lastPos, pos - 1);
lastPos = pos;
}
}
isEscaped = (ch === 0x5c/* \ */);
pos++;
ch = str.charCodeAt(pos);
}
result.push(current + str.substring(lastPos));
return result;
}
module.exports = function table(state, startLine, endLine, silent) {
var ch, lineText, pos, i, l, nextLine, columns, columnCount, token,
aligns, t, tableLines, tbodyLines, oldParentType, terminate,
terminatorRules, firstCh, secondCh;
// should have at least two lines
if (startLine + 2 > endLine) { return false; }
nextLine = startLine + 1;
if (state.sCount[nextLine] < state.blkIndent) { return false; }
// if it's indented more than 3 spaces, it should be a code block
if (state.sCount[nextLine] - state.blkIndent >= 4) { return false; }
// first character of the second line should be '|', '-', ':',
// and no other characters are allowed but spaces;
// basically, this is the equivalent of /^[-:|][-:|\s]*$/ regexp
pos = state.bMarks[nextLine] + state.tShift[nextLine];
if (pos >= state.eMarks[nextLine]) { return false; }
firstCh = state.src.charCodeAt(pos++);
if (firstCh !== 0x7C/* | */ && firstCh !== 0x2D/* - */ && firstCh !== 0x3A/* : */) { return false; }
if (pos >= state.eMarks[nextLine]) { return false; }
secondCh = state.src.charCodeAt(pos++);
if (secondCh !== 0x7C/* | */ && secondCh !== 0x2D/* - */ && secondCh !== 0x3A/* : */ && !isSpace(secondCh)) {
return false;
}
// if first character is '-', then second character must not be a space
// (due to parsing ambiguity with list)
if (firstCh === 0x2D/* - */ && isSpace(secondCh)) { return false; }
while (pos < state.eMarks[nextLine]) {
ch = state.src.charCodeAt(pos);
if (ch !== 0x7C/* | */ && ch !== 0x2D/* - */ && ch !== 0x3A/* : */ && !isSpace(ch)) { return false; }
pos++;
}
lineText = getLine(state, startLine + 1);
columns = lineText.split('|');
aligns = [];
for (i = 0; i < columns.length; i++) {
t = columns[i].trim();
if (!t) {
// allow empty columns before and after table, but not in between columns;
// e.g. allow ` |---| `, disallow ` ---||--- `
if (i === 0 || i === columns.length - 1) {
continue;
} else {
return false;
}
}
if (!/^:?-+:?$/.test(t)) { return false; }
if (t.charCodeAt(t.length - 1) === 0x3A/* : */) {
aligns.push(t.charCodeAt(0) === 0x3A/* : */ ? 'center' : 'right');
} else if (t.charCodeAt(0) === 0x3A/* : */) {
aligns.push('left');
} else {
aligns.push('');
}
}
lineText = getLine(state, startLine).trim();
if (lineText.indexOf('|') === -1) { return false; }
if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
columns = escapedSplit(lineText);
if (columns.length && columns[0] === '') columns.shift();
if (columns.length && columns[columns.length - 1] === '') columns.pop();
// header row will define an amount of columns in the entire table,
// and align row should be exactly the same (the rest of the rows can differ)
columnCount = columns.length;
if (columnCount === 0 || columnCount !== aligns.length) { return false; }
if (silent) { return true; }
oldParentType = state.parentType;
state.parentType = 'table';
// use 'blockquote' lists for termination because it's
// the most similar to tables
terminatorRules = state.md.block.ruler.getRules('blockquote');
token = state.push('table_open', 'table', 1);
token.map = tableLines = [ startLine, 0 ];
token = state.push('thead_open', 'thead', 1);
token.map = [ startLine, startLine + 1 ];
token = state.push('tr_open', 'tr', 1);
token.map = [ startLine, startLine + 1 ];
for (i = 0; i < columns.length; i++) {
token = state.push('th_open', 'th', 1);
if (aligns[i]) {
token.attrs = [ [ 'style', 'text-align:' + aligns[i] ] ];
}
token = state.push('inline', '', 0);
token.content = columns[i].trim();
token.children = [];
token = state.push('th_close', 'th', -1);
}
token = state.push('tr_close', 'tr', -1);
token = state.push('thead_close', 'thead', -1);
for (nextLine = startLine + 2; nextLine < endLine; nextLine++) {
if (state.sCount[nextLine] < state.blkIndent) { break; }
terminate = false;
for (i = 0, l = terminatorRules.length; i < l; i++) {
if (terminatorRules[i](state, nextLine, endLine, true)) {
terminate = true;
break;
}
}
if (terminate) { break; }
lineText = getLine(state, nextLine).trim();
if (!lineText) { break; }
if (state.sCount[nextLine] - state.blkIndent >= 4) { break; }
columns = escapedSplit(lineText);
if (columns.length && columns[0] === '') columns.shift();
if (columns.length && columns[columns.length - 1] === '') columns.pop();
if (nextLine === startLine + 2) {
token = state.push('tbody_open', 'tbody', 1);
token.map = tbodyLines = [ startLine + 2, 0 ];
}
token = state.push('tr_open', 'tr', 1);
token.map = [ nextLine, nextLine + 1 ];
for (i = 0; i < columnCount; i++) {
token = state.push('td_open', 'td', 1);
if (aligns[i]) {
token.attrs = [ [ 'style', 'text-align:' + aligns[i] ] ];
}
token = state.push('inline', '', 0);
token.content = columns[i] ? columns[i].trim() : '';
token.children = [];
token = state.push('td_close', 'td', -1);
}
token = state.push('tr_close', 'tr', -1);
}
if (tbodyLines) {
token = state.push('tbody_close', 'tbody', -1);
tbodyLines[1] = nextLine;
}
token = state.push('table_close', 'table', -1);
tableLines[1] = nextLine;
state.parentType = oldParentType;
state.line = nextLine;
return true;
};
/***/ }),
/***/ "./node_modules/markdown-it/lib/rules_core/block.js":
/*!**********************************************************!*\
!*** ./node_modules/markdown-it/lib/rules_core/block.js ***!
\**********************************************************/
/***/ ((module) => {
"use strict";
module.exports = function block(state) {
var token;
if (state.inlineMode) {
token = new state.Token('inline', '', 0);
token.content = state.src;
token.map = [ 0, 1 ];
token.children = [];
state.tokens.push(token);
} else {
state.md.block.parse(state.src, state.md, state.env, state.tokens);
}
};
/***/ }),
/***/ "./node_modules/markdown-it/lib/rules_core/inline.js":
/*!***********************************************************!*\
!*** ./node_modules/markdown-it/lib/rules_core/inline.js ***!
\***********************************************************/
/***/ ((module) => {
"use strict";
module.exports = function inline(state) {
var tokens = state.tokens, tok, i, l;
// Parse inlines
for (i = 0, l = tokens.length; i < l; i++) {
tok = tokens[i];
if (tok.type === 'inline') {
state.md.inline.parse(tok.content, state.md, state.env, tok.children);
}
}
};
/***/ }),
/***/ "./node_modules/markdown-it/lib/rules_core/linkify.js":
/*!************************************************************!*\
!*** ./node_modules/markdown-it/lib/rules_core/linkify.js ***!
\************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
// Replace link-like texts with link nodes.
//
// Currently restricted by `md.validateLink()` to http/https/ftp
//
var arrayReplaceAt = __webpack_require__(/*! ../common/utils */ "./node_modules/markdown-it/lib/common/utils.js").arrayReplaceAt;
function isLinkOpen(str) {
return /^\s]/i.test(str);
}
function isLinkClose(str) {
return /^<\/a\s*>/i.test(str);
}
module.exports = function linkify(state) {
var i, j, l, tokens, token, currentToken, nodes, ln, text, pos, lastPos,
level, htmlLinkLevel, url, fullUrl, urlText,
blockTokens = state.tokens,
links;
if (!state.md.options.linkify) { return; }
for (j = 0, l = blockTokens.length; j < l; j++) {
if (blockTokens[j].type !== 'inline' ||
!state.md.linkify.pretest(blockTokens[j].content)) {
continue;
}
tokens = blockTokens[j].children;
htmlLinkLevel = 0;
// We scan from the end, to keep position when new tags added.
// Use reversed logic in links start/end match
for (i = tokens.length - 1; i >= 0; i--) {
currentToken = tokens[i];
// Skip content of markdown links
if (currentToken.type === 'link_close') {
i--;
while (tokens[i].level !== currentToken.level && tokens[i].type !== 'link_open') {
i--;
}
continue;
}
// Skip content of html tag links
if (currentToken.type === 'html_inline') {
if (isLinkOpen(currentToken.content) && htmlLinkLevel > 0) {
htmlLinkLevel--;
}
if (isLinkClose(currentToken.content)) {
htmlLinkLevel++;
}
}
if (htmlLinkLevel > 0) { continue; }
if (currentToken.type === 'text' && state.md.linkify.test(currentToken.content)) {
text = currentToken.content;
links = state.md.linkify.match(text);
// Now split string to nodes
nodes = [];
level = currentToken.level;
lastPos = 0;
for (ln = 0; ln < links.length; ln++) {
url = links[ln].url;
fullUrl = state.md.normalizeLink(url);
if (!state.md.validateLink(fullUrl)) { continue; }
urlText = links[ln].text;
// Linkifier might send raw hostnames like "example.com", where url
// starts with domain name. So we prepend http:// in those cases,
// and remove it afterwards.
//
if (!links[ln].schema) {
urlText = state.md.normalizeLinkText('http://' + urlText).replace(/^http:\/\//, '');
} else if (links[ln].schema === 'mailto:' && !/^mailto:/i.test(urlText)) {
urlText = state.md.normalizeLinkText('mailto:' + urlText).replace(/^mailto:/, '');
} else {
urlText = state.md.normalizeLinkText(urlText);
}
pos = links[ln].index;
if (pos > lastPos) {
token = new state.Token('text', '', 0);
token.content = text.slice(lastPos, pos);
token.level = level;
nodes.push(token);
}
token = new state.Token('link_open', 'a', 1);
token.attrs = [ [ 'href', fullUrl ] ];
token.level = level++;
token.markup = 'linkify';
token.info = 'auto';
nodes.push(token);
token = new state.Token('text', '', 0);
token.content = urlText;
token.level = level;
nodes.push(token);
token = new state.Token('link_close', 'a', -1);
token.level = --level;
token.markup = 'linkify';
token.info = 'auto';
nodes.push(token);
lastPos = links[ln].lastIndex;
}
if (lastPos < text.length) {
token = new state.Token('text', '', 0);
token.content = text.slice(lastPos);
token.level = level;
nodes.push(token);
}
// replace current node
blockTokens[j].children = tokens = arrayReplaceAt(tokens, i, nodes);
}
}
}
};
/***/ }),
/***/ "./node_modules/markdown-it/lib/rules_core/normalize.js":
/*!**************************************************************!*\
!*** ./node_modules/markdown-it/lib/rules_core/normalize.js ***!
\**************************************************************/
/***/ ((module) => {
"use strict";
// Normalize input string
// https://spec.commonmark.org/0.29/#line-ending
var NEWLINES_RE = /\r\n?|\n/g;
var NULL_RE = /\0/g;
module.exports = function normalize(state) {
var str;
// Normalize newlines
str = state.src.replace(NEWLINES_RE, '\n');
// Replace NULL characters
str = str.replace(NULL_RE, '\uFFFD');
state.src = str;
};
/***/ }),
/***/ "./node_modules/markdown-it/lib/rules_core/replacements.js":
/*!*****************************************************************!*\
!*** ./node_modules/markdown-it/lib/rules_core/replacements.js ***!
\*****************************************************************/
/***/ ((module) => {
"use strict";
// Simple typographic replacements
//
// (c) (C) → ©
// (tm) (TM) → ™
// (r) (R) → ®
// +- → ±
// (p) (P) -> §
// ... → … (also ?.... → ?.., !.... → !..)
// ???????? → ???, !!!!! → !!!, `,,` → `,`
// -- → –, --- → —
//
// TODO:
// - fractionals 1/2, 1/4, 3/4 -> ½, ¼, ¾
// - miltiplication 2 x 4 -> 2 × 4
var RARE_RE = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/;
// Workaround for phantomjs - need regex without /g flag,
// or root check will fail every second time
var SCOPED_ABBR_TEST_RE = /\((c|tm|r|p)\)/i;
var SCOPED_ABBR_RE = /\((c|tm|r|p)\)/ig;
var SCOPED_ABBR = {
c: '©',
r: '®',
p: '§',
tm: '™'
};
function replaceFn(match, name) {
return SCOPED_ABBR[name.toLowerCase()];
}
function replace_scoped(inlineTokens) {
var i, token, inside_autolink = 0;
for (i = inlineTokens.length - 1; i >= 0; i--) {
token = inlineTokens[i];
if (token.type === 'text' && !inside_autolink) {
token.content = token.content.replace(SCOPED_ABBR_RE, replaceFn);
}
if (token.type === 'link_open' && token.info === 'auto') {
inside_autolink--;
}
if (token.type === 'link_close' && token.info === 'auto') {
inside_autolink++;
}
}
}
function replace_rare(inlineTokens) {
var i, token, inside_autolink = 0;
for (i = inlineTokens.length - 1; i >= 0; i--) {
token = inlineTokens[i];
if (token.type === 'text' && !inside_autolink) {
if (RARE_RE.test(token.content)) {
token.content = token.content
.replace(/\+-/g, '±')
// .., ..., ....... -> …
// but ?..... & !..... -> ?.. & !..
.replace(/\.{2,}/g, '…').replace(/([?!])…/g, '$1..')
.replace(/([?!]){4,}/g, '$1$1$1').replace(/,{2,}/g, ',')
// em-dash
.replace(/(^|[^-])---(?=[^-]|$)/mg, '$1\u2014')
// en-dash
.replace(/(^|\s)--(?=\s|$)/mg, '$1\u2013')
.replace(/(^|[^-\s])--(?=[^-\s]|$)/mg, '$1\u2013');
}
}
if (token.type === 'link_open' && token.info === 'auto') {
inside_autolink--;
}
if (token.type === 'link_close' && token.info === 'auto') {
inside_autolink++;
}
}
}
module.exports = function replace(state) {
var blkIdx;
if (!state.md.options.typographer) { return; }
for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {
if (state.tokens[blkIdx].type !== 'inline') { continue; }
if (SCOPED_ABBR_TEST_RE.test(state.tokens[blkIdx].content)) {
replace_scoped(state.tokens[blkIdx].children);
}
if (RARE_RE.test(state.tokens[blkIdx].content)) {
replace_rare(state.tokens[blkIdx].children);
}
}
};
/***/ }),
/***/ "./node_modules/markdown-it/lib/rules_core/smartquotes.js":
/*!****************************************************************!*\
!*** ./node_modules/markdown-it/lib/rules_core/smartquotes.js ***!
\****************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
// Convert straight quotation marks to typographic ones
//
var isWhiteSpace = __webpack_require__(/*! ../common/utils */ "./node_modules/markdown-it/lib/common/utils.js").isWhiteSpace;
var isPunctChar = __webpack_require__(/*! ../common/utils */ "./node_modules/markdown-it/lib/common/utils.js").isPunctChar;
var isMdAsciiPunct = __webpack_require__(/*! ../common/utils */ "./node_modules/markdown-it/lib/common/utils.js").isMdAsciiPunct;
var QUOTE_TEST_RE = /['"]/;
var QUOTE_RE = /['"]/g;
var APOSTROPHE = '\u2019'; /* ’ */
function replaceAt(str, index, ch) {
return str.substr(0, index) + ch + str.substr(index + 1);
}
function process_inlines(tokens, state) {
var i, token, text, t, pos, max, thisLevel, item, lastChar, nextChar,
isLastPunctChar, isNextPunctChar, isLastWhiteSpace, isNextWhiteSpace,
canOpen, canClose, j, isSingle, stack, openQuote, closeQuote;
stack = [];
for (i = 0; i < tokens.length; i++) {
token = tokens[i];
thisLevel = tokens[i].level;
for (j = stack.length - 1; j >= 0; j--) {
if (stack[j].level <= thisLevel) { break; }
}
stack.length = j + 1;
if (token.type !== 'text') { continue; }
text = token.content;
pos = 0;
max = text.length;
/*eslint no-labels:0,block-scoped-var:0*/
OUTER:
while (pos < max) {
QUOTE_RE.lastIndex = pos;
t = QUOTE_RE.exec(text);
if (!t) { break; }
canOpen = canClose = true;
pos = t.index + 1;
isSingle = (t[0] === "'");
// Find previous character,
// default to space if it's the beginning of the line
//
lastChar = 0x20;
if (t.index - 1 >= 0) {
lastChar = text.charCodeAt(t.index - 1);
} else {
for (j = i - 1; j >= 0; j--) {
if (tokens[j].type === 'softbreak' || tokens[j].type === 'hardbreak') break; // lastChar defaults to 0x20
if (!tokens[j].content) continue; // should skip all tokens except 'text', 'html_inline' or 'code_inline'
lastChar = tokens[j].content.charCodeAt(tokens[j].content.length - 1);
break;
}
}
// Find next character,
// default to space if it's the end of the line
//
nextChar = 0x20;
if (pos < max) {
nextChar = text.charCodeAt(pos);
} else {
for (j = i + 1; j < tokens.length; j++) {
if (tokens[j].type === 'softbreak' || tokens[j].type === 'hardbreak') break; // nextChar defaults to 0x20
if (!tokens[j].content) continue; // should skip all tokens except 'text', 'html_inline' or 'code_inline'
nextChar = tokens[j].content.charCodeAt(0);
break;
}
}
isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));
isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));
isLastWhiteSpace = isWhiteSpace(lastChar);
isNextWhiteSpace = isWhiteSpace(nextChar);
if (isNextWhiteSpace) {
canOpen = false;
} else if (isNextPunctChar) {
if (!(isLastWhiteSpace || isLastPunctChar)) {
canOpen = false;
}
}
if (isLastWhiteSpace) {
canClose = false;
} else if (isLastPunctChar) {
if (!(isNextWhiteSpace || isNextPunctChar)) {
canClose = false;
}
}
if (nextChar === 0x22 /* " */ && t[0] === '"') {
if (lastChar >= 0x30 /* 0 */ && lastChar <= 0x39 /* 9 */) {
// special case: 1"" - count first quote as an inch
canClose = canOpen = false;
}
}
if (canOpen && canClose) {
// Replace quotes in the middle of punctuation sequence, but not
// in the middle of the words, i.e.:
//
// 1. foo " bar " baz - not replaced
// 2. foo-"-bar-"-baz - replaced
// 3. foo"bar"baz - not replaced
//
canOpen = isLastPunctChar;
canClose = isNextPunctChar;
}
if (!canOpen && !canClose) {
// middle of word
if (isSingle) {
token.content = replaceAt(token.content, t.index, APOSTROPHE);
}
continue;
}
if (canClose) {
// this could be a closing quote, rewind the stack to get a match
for (j = stack.length - 1; j >= 0; j--) {
item = stack[j];
if (stack[j].level < thisLevel) { break; }
if (item.single === isSingle && stack[j].level === thisLevel) {
item = stack[j];
if (isSingle) {
openQuote = state.md.options.quotes[2];
closeQuote = state.md.options.quotes[3];
} else {
openQuote = state.md.options.quotes[0];
closeQuote = state.md.options.quotes[1];
}
// replace token.content *before* tokens[item.token].content,
// because, if they are pointing at the same token, replaceAt
// could mess up indices when quote length != 1
token.content = replaceAt(token.content, t.index, closeQuote);
tokens[item.token].content = replaceAt(
tokens[item.token].content, item.pos, openQuote);
pos += closeQuote.length - 1;
if (item.token === i) { pos += openQuote.length - 1; }
text = token.content;
max = text.length;
stack.length = j;
continue OUTER;
}
}
}
if (canOpen) {
stack.push({
token: i,
pos: t.index,
single: isSingle,
level: thisLevel
});
} else if (canClose && isSingle) {
token.content = replaceAt(token.content, t.index, APOSTROPHE);
}
}
}
}
module.exports = function smartquotes(state) {
/*eslint max-depth:0*/
var blkIdx;
if (!state.md.options.typographer) { return; }
for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {
if (state.tokens[blkIdx].type !== 'inline' ||
!QUOTE_TEST_RE.test(state.tokens[blkIdx].content)) {
continue;
}
process_inlines(state.tokens[blkIdx].children, state);
}
};
/***/ }),
/***/ "./node_modules/markdown-it/lib/rules_core/state_core.js":
/*!***************************************************************!*\
!*** ./node_modules/markdown-it/lib/rules_core/state_core.js ***!
\***************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
// Core state object
//
var Token = __webpack_require__(/*! ../token */ "./node_modules/markdown-it/lib/token.js");
function StateCore(src, md, env) {
this.src = src;
this.env = env;
this.tokens = [];
this.inlineMode = false;
this.md = md; // link to parser instance
}
// re-export Token class to use in core rules
StateCore.prototype.Token = Token;
module.exports = StateCore;
/***/ }),
/***/ "./node_modules/markdown-it/lib/rules_inline/autolink.js":
/*!***************************************************************!*\
!*** ./node_modules/markdown-it/lib/rules_inline/autolink.js ***!
\***************************************************************/
/***/ ((module) => {
"use strict";
// Process autolinks ''
/*eslint max-len:0*/
var EMAIL_RE = /^([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/;
var AUTOLINK_RE = /^([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)$/;
module.exports = function autolink(state, silent) {
var url, fullUrl, token, ch, start, max,
pos = state.pos;
if (state.src.charCodeAt(pos) !== 0x3C/* < */) { return false; }
start = state.pos;
max = state.posMax;
for (;;) {
if (++pos >= max) return false;
ch = state.src.charCodeAt(pos);
if (ch === 0x3C /* < */) return false;
if (ch === 0x3E /* > */) break;
}
url = state.src.slice(start + 1, pos);
if (AUTOLINK_RE.test(url)) {
fullUrl = state.md.normalizeLink(url);
if (!state.md.validateLink(fullUrl)) { return false; }
if (!silent) {
token = state.push('link_open', 'a', 1);
token.attrs = [ [ 'href', fullUrl ] ];
token.markup = 'autolink';
token.info = 'auto';
token = state.push('text', '', 0);
token.content = state.md.normalizeLinkText(url);
token = state.push('link_close', 'a', -1);
token.markup = 'autolink';
token.info = 'auto';
}
state.pos += url.length + 2;
return true;
}
if (EMAIL_RE.test(url)) {
fullUrl = state.md.normalizeLink('mailto:' + url);
if (!state.md.validateLink(fullUrl)) { return false; }
if (!silent) {
token = state.push('link_open', 'a', 1);
token.attrs = [ [ 'href', fullUrl ] ];
token.markup = 'autolink';
token.info = 'auto';
token = state.push('text', '', 0);
token.content = state.md.normalizeLinkText(url);
token = state.push('link_close', 'a', -1);
token.markup = 'autolink';
token.info = 'auto';
}
state.pos += url.length + 2;
return true;
}
return false;
};
/***/ }),
/***/ "./node_modules/markdown-it/lib/rules_inline/backticks.js":
/*!****************************************************************!*\
!*** ./node_modules/markdown-it/lib/rules_inline/backticks.js ***!
\****************************************************************/
/***/ ((module) => {
"use strict";
// Parse backticks
module.exports = function backtick(state, silent) {
var start, max, marker, token, matchStart, matchEnd, openerLength, closerLength,
pos = state.pos,
ch = state.src.charCodeAt(pos);
if (ch !== 0x60/* ` */) { return false; }
start = pos;
pos++;
max = state.posMax;
// scan marker length
while (pos < max && state.src.charCodeAt(pos) === 0x60/* ` */) { pos++; }
marker = state.src.slice(start, pos);
openerLength = marker.length;
if (state.backticksScanned && (state.backticks[openerLength] || 0) <= start) {
if (!silent) state.pending += marker;
state.pos += openerLength;
return true;
}
matchStart = matchEnd = pos;
// Nothing found in the cache, scan until the end of the line (or until marker is found)
while ((matchStart = state.src.indexOf('`', matchEnd)) !== -1) {
matchEnd = matchStart + 1;
// scan marker length
while (matchEnd < max && state.src.charCodeAt(matchEnd) === 0x60/* ` */) { matchEnd++; }
closerLength = matchEnd - matchStart;
if (closerLength === openerLength) {
// Found matching closer length.
if (!silent) {
token = state.push('code_inline', 'code', 0);
token.markup = marker;
token.content = state.src.slice(pos, matchStart)
.replace(/\n/g, ' ')
.replace(/^ (.+) $/, '$1');
}
state.pos = matchEnd;
return true;
}
// Some different length found, put it in cache as upper limit of where closer can be found
state.backticks[closerLength] = matchStart;
}
// Scanned through the end, didn't find anything
state.backticksScanned = true;
if (!silent) state.pending += marker;
state.pos += openerLength;
return true;
};
/***/ }),
/***/ "./node_modules/markdown-it/lib/rules_inline/balance_pairs.js":
/*!********************************************************************!*\
!*** ./node_modules/markdown-it/lib/rules_inline/balance_pairs.js ***!
\********************************************************************/
/***/ ((module) => {
"use strict";
// For each opening emphasis-like marker find a matching closing one
//
function processDelimiters(state, delimiters) {
var closerIdx, openerIdx, closer, opener, minOpenerIdx, newMinOpenerIdx,
isOddMatch, lastJump,
openersBottom = {},
max = delimiters.length;
for (closerIdx = 0; closerIdx < max; closerIdx++) {
closer = delimiters[closerIdx];
// Length is only used for emphasis-specific "rule of 3",
// if it's not defined (in strikethrough or 3rd party plugins),
// we can default it to 0 to disable those checks.
//
closer.length = closer.length || 0;
if (!closer.close) continue;
// Previously calculated lower bounds (previous fails)
// for each marker, each delimiter length modulo 3,
// and for whether this closer can be an opener;
// https://github.com/commonmark/cmark/commit/34250e12ccebdc6372b8b49c44fab57c72443460
if (!openersBottom.hasOwnProperty(closer.marker)) {
openersBottom[closer.marker] = [ -1, -1, -1, -1, -1, -1 ];
}
minOpenerIdx = openersBottom[closer.marker][(closer.open ? 3 : 0) + (closer.length % 3)];
openerIdx = closerIdx - closer.jump - 1;
// avoid crash if `closer.jump` is pointing outside of the array, see #742
if (openerIdx < -1) openerIdx = -1;
newMinOpenerIdx = openerIdx;
for (; openerIdx > minOpenerIdx; openerIdx -= opener.jump + 1) {
opener = delimiters[openerIdx];
if (opener.marker !== closer.marker) continue;
if (opener.open && opener.end < 0) {
isOddMatch = false;
// from spec:
//
// If one of the delimiters can both open and close emphasis, then the
// sum of the lengths of the delimiter runs containing the opening and
// closing delimiters must not be a multiple of 3 unless both lengths
// are multiples of 3.
//
if (opener.close || closer.open) {
if ((opener.length + closer.length) % 3 === 0) {
if (opener.length % 3 !== 0 || closer.length % 3 !== 0) {
isOddMatch = true;
}
}
}
if (!isOddMatch) {
// If previous delimiter cannot be an opener, we can safely skip
// the entire sequence in future checks. This is required to make
// sure algorithm has linear complexity (see *_*_*_*_*_... case).
//
lastJump = openerIdx > 0 && !delimiters[openerIdx - 1].open ?
delimiters[openerIdx - 1].jump + 1 :
0;
closer.jump = closerIdx - openerIdx + lastJump;
closer.open = false;
opener.end = closerIdx;
opener.jump = lastJump;
opener.close = false;
newMinOpenerIdx = -1;
break;
}
}
}
if (newMinOpenerIdx !== -1) {
// If match for this delimiter run failed, we want to set lower bound for
// future lookups. This is required to make sure algorithm has linear
// complexity.
//
// See details here:
// https://github.com/commonmark/cmark/issues/178#issuecomment-270417442
//
openersBottom[closer.marker][(closer.open ? 3 : 0) + ((closer.length || 0) % 3)] = newMinOpenerIdx;
}
}
}
module.exports = function link_pairs(state) {
var curr,
tokens_meta = state.tokens_meta,
max = state.tokens_meta.length;
processDelimiters(state, state.delimiters);
for (curr = 0; curr < max; curr++) {
if (tokens_meta[curr] && tokens_meta[curr].delimiters) {
processDelimiters(state, tokens_meta[curr].delimiters);
}
}
};
/***/ }),
/***/ "./node_modules/markdown-it/lib/rules_inline/emphasis.js":
/*!***************************************************************!*\
!*** ./node_modules/markdown-it/lib/rules_inline/emphasis.js ***!
\***************************************************************/
/***/ ((module) => {
"use strict";
// Process *this* and _that_
//
// Insert each marker as a separate text token, and add it to delimiter list
//
module.exports.tokenize = function emphasis(state, silent) {
var i, scanned, token,
start = state.pos,
marker = state.src.charCodeAt(start);
if (silent) { return false; }
if (marker !== 0x5F /* _ */ && marker !== 0x2A /* * */) { return false; }
scanned = state.scanDelims(state.pos, marker === 0x2A);
for (i = 0; i < scanned.length; i++) {
token = state.push('text', '', 0);
token.content = String.fromCharCode(marker);
state.delimiters.push({
// Char code of the starting marker (number).
//
marker: marker,
// Total length of these series of delimiters.
//
length: scanned.length,
// An amount of characters before this one that's equivalent to
// current one. In plain English: if this delimiter does not open
// an emphasis, neither do previous `jump` characters.
//
// Used to skip sequences like "*****" in one step, for 1st asterisk
// value will be 0, for 2nd it's 1 and so on.
//
jump: i,
// A position of the token this delimiter corresponds to.
//
token: state.tokens.length - 1,
// If this delimiter is matched as a valid opener, `end` will be
// equal to its position, otherwise it's `-1`.
//
end: -1,
// Boolean flags that determine if this delimiter could open or close
// an emphasis.
//
open: scanned.can_open,
close: scanned.can_close
});
}
state.pos += scanned.length;
return true;
};
function postProcess(state, delimiters) {
var i,
startDelim,
endDelim,
token,
ch,
isStrong,
max = delimiters.length;
for (i = max - 1; i >= 0; i--) {
startDelim = delimiters[i];
if (startDelim.marker !== 0x5F/* _ */ && startDelim.marker !== 0x2A/* * */) {
continue;
}
// Process only opening markers
if (startDelim.end === -1) {
continue;
}
endDelim = delimiters[startDelim.end];
// If the previous delimiter has the same marker and is adjacent to this one,
// merge those into one strong delimiter.
//
// `whatever` -> `whatever`
//
isStrong = i > 0 &&
delimiters[i - 1].end === startDelim.end + 1 &&
delimiters[i - 1].token === startDelim.token - 1 &&
delimiters[startDelim.end + 1].token === endDelim.token + 1 &&
delimiters[i - 1].marker === startDelim.marker;
ch = String.fromCharCode(startDelim.marker);
token = state.tokens[startDelim.token];
token.type = isStrong ? 'strong_open' : 'em_open';
token.tag = isStrong ? 'strong' : 'em';
token.nesting = 1;
token.markup = isStrong ? ch + ch : ch;
token.content = '';
token = state.tokens[endDelim.token];
token.type = isStrong ? 'strong_close' : 'em_close';
token.tag = isStrong ? 'strong' : 'em';
token.nesting = -1;
token.markup = isStrong ? ch + ch : ch;
token.content = '';
if (isStrong) {
state.tokens[delimiters[i - 1].token].content = '';
state.tokens[delimiters[startDelim.end + 1].token].content = '';
i--;
}
}
}
// Walk through delimiter list and replace text tokens with tags
//
module.exports.postProcess = function emphasis(state) {
var curr,
tokens_meta = state.tokens_meta,
max = state.tokens_meta.length;
postProcess(state, state.delimiters);
for (curr = 0; curr < max; curr++) {
if (tokens_meta[curr] && tokens_meta[curr].delimiters) {
postProcess(state, tokens_meta[curr].delimiters);
}
}
};
/***/ }),
/***/ "./node_modules/markdown-it/lib/rules_inline/entity.js":
/*!*************************************************************!*\
!*** ./node_modules/markdown-it/lib/rules_inline/entity.js ***!
\*************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
// Process html entity - {, ¯, ", ...
var entities = __webpack_require__(/*! ../common/entities */ "./node_modules/markdown-it/lib/common/entities.js");
var has = __webpack_require__(/*! ../common/utils */ "./node_modules/markdown-it/lib/common/utils.js").has;
var isValidEntityCode = __webpack_require__(/*! ../common/utils */ "./node_modules/markdown-it/lib/common/utils.js").isValidEntityCode;
var fromCodePoint = __webpack_require__(/*! ../common/utils */ "./node_modules/markdown-it/lib/common/utils.js").fromCodePoint;
var DIGITAL_RE = /^((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i;
var NAMED_RE = /^&([a-z][a-z0-9]{1,31});/i;
module.exports = function entity(state, silent) {
var ch, code, match, pos = state.pos, max = state.posMax;
if (state.src.charCodeAt(pos) !== 0x26/* & */) { return false; }
if (pos + 1 < max) {
ch = state.src.charCodeAt(pos + 1);
if (ch === 0x23 /* # */) {
match = state.src.slice(pos).match(DIGITAL_RE);
if (match) {
if (!silent) {
code = match[1][0].toLowerCase() === 'x' ? parseInt(match[1].slice(1), 16) : parseInt(match[1], 10);
state.pending += isValidEntityCode(code) ? fromCodePoint(code) : fromCodePoint(0xFFFD);
}
state.pos += match[0].length;
return true;
}
} else {
match = state.src.slice(pos).match(NAMED_RE);
if (match) {
if (has(entities, match[1])) {
if (!silent) { state.pending += entities[match[1]]; }
state.pos += match[0].length;
return true;
}
}
}
}
if (!silent) { state.pending += '&'; }
state.pos++;
return true;
};
/***/ }),
/***/ "./node_modules/markdown-it/lib/rules_inline/escape.js":
/*!*************************************************************!*\
!*** ./node_modules/markdown-it/lib/rules_inline/escape.js ***!
\*************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
// Process escaped chars and hardbreaks
var isSpace = __webpack_require__(/*! ../common/utils */ "./node_modules/markdown-it/lib/common/utils.js").isSpace;
var ESCAPED = [];
for (var i = 0; i < 256; i++) { ESCAPED.push(0); }
'\\!"#$%&\'()*+,./:;<=>?@[]^_`{|}~-'
.split('').forEach(function (ch) { ESCAPED[ch.charCodeAt(0)] = 1; });
module.exports = function escape(state, silent) {
var ch, pos = state.pos, max = state.posMax;
if (state.src.charCodeAt(pos) !== 0x5C/* \ */) { return false; }
pos++;
if (pos < max) {
ch = state.src.charCodeAt(pos);
if (ch < 256 && ESCAPED[ch] !== 0) {
if (!silent) { state.pending += state.src[pos]; }
state.pos += 2;
return true;
}
if (ch === 0x0A) {
if (!silent) {
state.push('hardbreak', 'br', 0);
}
pos++;
// skip leading whitespaces from next line
while (pos < max) {
ch = state.src.charCodeAt(pos);
if (!isSpace(ch)) { break; }
pos++;
}
state.pos = pos;
return true;
}
}
if (!silent) { state.pending += '\\'; }
state.pos++;
return true;
};
/***/ }),
/***/ "./node_modules/markdown-it/lib/rules_inline/html_inline.js":
/*!******************************************************************!*\
!*** ./node_modules/markdown-it/lib/rules_inline/html_inline.js ***!
\******************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
// Process html tags
var HTML_TAG_RE = __webpack_require__(/*! ../common/html_re */ "./node_modules/markdown-it/lib/common/html_re.js").HTML_TAG_RE;
function isLetter(ch) {
/*eslint no-bitwise:0*/
var lc = ch | 0x20; // to lower case
return (lc >= 0x61/* a */) && (lc <= 0x7a/* z */);
}
module.exports = function html_inline(state, silent) {
var ch, match, max, token,
pos = state.pos;
if (!state.md.options.html) { return false; }
// Check start
max = state.posMax;
if (state.src.charCodeAt(pos) !== 0x3C/* < */ ||
pos + 2 >= max) {
return false;
}
// Quick fail on second char
ch = state.src.charCodeAt(pos + 1);
if (ch !== 0x21/* ! */ &&
ch !== 0x3F/* ? */ &&
ch !== 0x2F/* / */ &&
!isLetter(ch)) {
return false;
}
match = state.src.slice(pos).match(HTML_TAG_RE);
if (!match) { return false; }
if (!silent) {
token = state.push('html_inline', '', 0);
token.content = state.src.slice(pos, pos + match[0].length);
}
state.pos += match[0].length;
return true;
};
/***/ }),
/***/ "./node_modules/markdown-it/lib/rules_inline/image.js":
/*!************************************************************!*\
!*** ./node_modules/markdown-it/lib/rules_inline/image.js ***!
\************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
// Process 
var normalizeReference = __webpack_require__(/*! ../common/utils */ "./node_modules/markdown-it/lib/common/utils.js").normalizeReference;
var isSpace = __webpack_require__(/*! ../common/utils */ "./node_modules/markdown-it/lib/common/utils.js").isSpace;
module.exports = function image(state, silent) {
var attrs,
code,
content,
label,
labelEnd,
labelStart,
pos,
ref,
res,
title,
token,
tokens,
start,
href = '',
oldPos = state.pos,
max = state.posMax;
if (state.src.charCodeAt(state.pos) !== 0x21/* ! */) { return false; }
if (state.src.charCodeAt(state.pos + 1) !== 0x5B/* [ */) { return false; }
labelStart = state.pos + 2;
labelEnd = state.md.helpers.parseLinkLabel(state, state.pos + 1, false);
// parser failed to find ']', so it's not a valid link
if (labelEnd < 0) { return false; }
pos = labelEnd + 1;
if (pos < max && state.src.charCodeAt(pos) === 0x28/* ( */) {
//
// Inline link
//
// [link]( "title" )
// ^^ skipping these spaces
pos++;
for (; pos < max; pos++) {
code = state.src.charCodeAt(pos);
if (!isSpace(code) && code !== 0x0A) { break; }
}
if (pos >= max) { return false; }
// [link]( "title" )
// ^^^^^^ parsing link destination
start = pos;
res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax);
if (res.ok) {
href = state.md.normalizeLink(res.str);
if (state.md.validateLink(href)) {
pos = res.pos;
} else {
href = '';
}
}
// [link]( "title" )
// ^^ skipping these spaces
start = pos;
for (; pos < max; pos++) {
code = state.src.charCodeAt(pos);
if (!isSpace(code) && code !== 0x0A) { break; }
}
// [link]( "title" )
// ^^^^^^^ parsing link title
res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax);
if (pos < max && start !== pos && res.ok) {
title = res.str;
pos = res.pos;
// [link]( "title" )
// ^^ skipping these spaces
for (; pos < max; pos++) {
code = state.src.charCodeAt(pos);
if (!isSpace(code) && code !== 0x0A) { break; }
}
} else {
title = '';
}
if (pos >= max || state.src.charCodeAt(pos) !== 0x29/* ) */) {
state.pos = oldPos;
return false;
}
pos++;
} else {
//
// Link reference
//
if (typeof state.env.references === 'undefined') { return false; }
if (pos < max && state.src.charCodeAt(pos) === 0x5B/* [ */) {
start = pos + 1;
pos = state.md.helpers.parseLinkLabel(state, pos);
if (pos >= 0) {
label = state.src.slice(start, pos++);
} else {
pos = labelEnd + 1;
}
} else {
pos = labelEnd + 1;
}
// covers label === '' and label === undefined
// (collapsed reference link and shortcut reference link respectively)
if (!label) { label = state.src.slice(labelStart, labelEnd); }
ref = state.env.references[normalizeReference(label)];
if (!ref) {
state.pos = oldPos;
return false;
}
href = ref.href;
title = ref.title;
}
//
// We found the end of the link, and know for a fact it's a valid link;
// so all that's left to do is to call tokenizer.
//
if (!silent) {
content = state.src.slice(labelStart, labelEnd);
state.md.inline.parse(
content,
state.md,
state.env,
tokens = []
);
token = state.push('image', 'img', 0);
token.attrs = attrs = [ [ 'src', href ], [ 'alt', '' ] ];
token.children = tokens;
token.content = content;
if (title) {
attrs.push([ 'title', title ]);
}
}
state.pos = pos;
state.posMax = max;
return true;
};
/***/ }),
/***/ "./node_modules/markdown-it/lib/rules_inline/link.js":
/*!***********************************************************!*\
!*** ./node_modules/markdown-it/lib/rules_inline/link.js ***!
\***********************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
// Process [link]( "stuff")
var normalizeReference = __webpack_require__(/*! ../common/utils */ "./node_modules/markdown-it/lib/common/utils.js").normalizeReference;
var isSpace = __webpack_require__(/*! ../common/utils */ "./node_modules/markdown-it/lib/common/utils.js").isSpace;
module.exports = function link(state, silent) {
var attrs,
code,
label,
labelEnd,
labelStart,
pos,
res,
ref,
token,
href = '',
title = '',
oldPos = state.pos,
max = state.posMax,
start = state.pos,
parseReference = true;
if (state.src.charCodeAt(state.pos) !== 0x5B/* [ */) { return false; }
labelStart = state.pos + 1;
labelEnd = state.md.helpers.parseLinkLabel(state, state.pos, true);
// parser failed to find ']', so it's not a valid link
if (labelEnd < 0) { return false; }
pos = labelEnd + 1;
if (pos < max && state.src.charCodeAt(pos) === 0x28/* ( */) {
//
// Inline link
//
// might have found a valid shortcut link, disable reference parsing
parseReference = false;
// [link]( "title" )
// ^^ skipping these spaces
pos++;
for (; pos < max; pos++) {
code = state.src.charCodeAt(pos);
if (!isSpace(code) && code !== 0x0A) { break; }
}
if (pos >= max) { return false; }
// [link]( "title" )
// ^^^^^^ parsing link destination
start = pos;
res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax);
if (res.ok) {
href = state.md.normalizeLink(res.str);
if (state.md.validateLink(href)) {
pos = res.pos;
} else {
href = '';
}
// [link]( "title" )
// ^^ skipping these spaces
start = pos;
for (; pos < max; pos++) {
code = state.src.charCodeAt(pos);
if (!isSpace(code) && code !== 0x0A) { break; }
}
// [link]( "title" )
// ^^^^^^^ parsing link title
res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax);
if (pos < max && start !== pos && res.ok) {
title = res.str;
pos = res.pos;
// [link]( "title" )
// ^^ skipping these spaces
for (; pos < max; pos++) {
code = state.src.charCodeAt(pos);
if (!isSpace(code) && code !== 0x0A) { break; }
}
}
}
if (pos >= max || state.src.charCodeAt(pos) !== 0x29/* ) */) {
// parsing a valid shortcut link failed, fallback to reference
parseReference = true;
}
pos++;
}
if (parseReference) {
//
// Link reference
//
if (typeof state.env.references === 'undefined') { return false; }
if (pos < max && state.src.charCodeAt(pos) === 0x5B/* [ */) {
start = pos + 1;
pos = state.md.helpers.parseLinkLabel(state, pos);
if (pos >= 0) {
label = state.src.slice(start, pos++);
} else {
pos = labelEnd + 1;
}
} else {
pos = labelEnd + 1;
}
// covers label === '' and label === undefined
// (collapsed reference link and shortcut reference link respectively)
if (!label) { label = state.src.slice(labelStart, labelEnd); }
ref = state.env.references[normalizeReference(label)];
if (!ref) {
state.pos = oldPos;
return false;
}
href = ref.href;
title = ref.title;
}
//
// We found the end of the link, and know for a fact it's a valid link;
// so all that's left to do is to call tokenizer.
//
if (!silent) {
state.pos = labelStart;
state.posMax = labelEnd;
token = state.push('link_open', 'a', 1);
token.attrs = attrs = [ [ 'href', href ] ];
if (title) {
attrs.push([ 'title', title ]);
}
state.md.inline.tokenize(state);
token = state.push('link_close', 'a', -1);
}
state.pos = pos;
state.posMax = max;
return true;
};
/***/ }),
/***/ "./node_modules/markdown-it/lib/rules_inline/newline.js":
/*!**************************************************************!*\
!*** ./node_modules/markdown-it/lib/rules_inline/newline.js ***!
\**************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
// Proceess '\n'
var isSpace = __webpack_require__(/*! ../common/utils */ "./node_modules/markdown-it/lib/common/utils.js").isSpace;
module.exports = function newline(state, silent) {
var pmax, max, pos = state.pos;
if (state.src.charCodeAt(pos) !== 0x0A/* \n */) { return false; }
pmax = state.pending.length - 1;
max = state.posMax;
// ' \n' -> hardbreak
// Lookup in pending chars is bad practice! Don't copy to other rules!
// Pending string is stored in concat mode, indexed lookups will cause
// convertion to flat mode.
if (!silent) {
if (pmax >= 0 && state.pending.charCodeAt(pmax) === 0x20) {
if (pmax >= 1 && state.pending.charCodeAt(pmax - 1) === 0x20) {
state.pending = state.pending.replace(/ +$/, '');
state.push('hardbreak', 'br', 0);
} else {
state.pending = state.pending.slice(0, -1);
state.push('softbreak', 'br', 0);
}
} else {
state.push('softbreak', 'br', 0);
}
}
pos++;
// skip heading spaces for next line
while (pos < max && isSpace(state.src.charCodeAt(pos))) { pos++; }
state.pos = pos;
return true;
};
/***/ }),
/***/ "./node_modules/markdown-it/lib/rules_inline/state_inline.js":
/*!*******************************************************************!*\
!*** ./node_modules/markdown-it/lib/rules_inline/state_inline.js ***!
\*******************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
// Inline parser state
var Token = __webpack_require__(/*! ../token */ "./node_modules/markdown-it/lib/token.js");
var isWhiteSpace = __webpack_require__(/*! ../common/utils */ "./node_modules/markdown-it/lib/common/utils.js").isWhiteSpace;
var isPunctChar = __webpack_require__(/*! ../common/utils */ "./node_modules/markdown-it/lib/common/utils.js").isPunctChar;
var isMdAsciiPunct = __webpack_require__(/*! ../common/utils */ "./node_modules/markdown-it/lib/common/utils.js").isMdAsciiPunct;
function StateInline(src, md, env, outTokens) {
this.src = src;
this.env = env;
this.md = md;
this.tokens = outTokens;
this.tokens_meta = Array(outTokens.length);
this.pos = 0;
this.posMax = this.src.length;
this.level = 0;
this.pending = '';
this.pendingLevel = 0;
// Stores { start: end } pairs. Useful for backtrack
// optimization of pairs parse (emphasis, strikes).
this.cache = {};
// List of emphasis-like delimiters for current tag
this.delimiters = [];
// Stack of delimiter lists for upper level tags
this._prev_delimiters = [];
// backtick length => last seen position
this.backticks = {};
this.backticksScanned = false;
}
// Flush pending text
//
StateInline.prototype.pushPending = function () {
var token = new Token('text', '', 0);
token.content = this.pending;
token.level = this.pendingLevel;
this.tokens.push(token);
this.pending = '';
return token;
};
// Push new token to "stream".
// If pending text exists - flush it as text token
//
StateInline.prototype.push = function (type, tag, nesting) {
if (this.pending) {
this.pushPending();
}
var token = new Token(type, tag, nesting);
var token_meta = null;
if (nesting < 0) {
// closing tag
this.level--;
this.delimiters = this._prev_delimiters.pop();
}
token.level = this.level;
if (nesting > 0) {
// opening tag
this.level++;
this._prev_delimiters.push(this.delimiters);
this.delimiters = [];
token_meta = { delimiters: this.delimiters };
}
this.pendingLevel = this.level;
this.tokens.push(token);
this.tokens_meta.push(token_meta);
return token;
};
// Scan a sequence of emphasis-like markers, and determine whether
// it can start an emphasis sequence or end an emphasis sequence.
//
// - start - position to scan from (it should point at a valid marker);
// - canSplitWord - determine if these markers can be found inside a word
//
StateInline.prototype.scanDelims = function (start, canSplitWord) {
var pos = start, lastChar, nextChar, count, can_open, can_close,
isLastWhiteSpace, isLastPunctChar,
isNextWhiteSpace, isNextPunctChar,
left_flanking = true,
right_flanking = true,
max = this.posMax,
marker = this.src.charCodeAt(start);
// treat beginning of the line as a whitespace
lastChar = start > 0 ? this.src.charCodeAt(start - 1) : 0x20;
while (pos < max && this.src.charCodeAt(pos) === marker) { pos++; }
count = pos - start;
// treat end of the line as a whitespace
nextChar = pos < max ? this.src.charCodeAt(pos) : 0x20;
isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));
isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));
isLastWhiteSpace = isWhiteSpace(lastChar);
isNextWhiteSpace = isWhiteSpace(nextChar);
if (isNextWhiteSpace) {
left_flanking = false;
} else if (isNextPunctChar) {
if (!(isLastWhiteSpace || isLastPunctChar)) {
left_flanking = false;
}
}
if (isLastWhiteSpace) {
right_flanking = false;
} else if (isLastPunctChar) {
if (!(isNextWhiteSpace || isNextPunctChar)) {
right_flanking = false;
}
}
if (!canSplitWord) {
can_open = left_flanking && (!right_flanking || isLastPunctChar);
can_close = right_flanking && (!left_flanking || isNextPunctChar);
} else {
can_open = left_flanking;
can_close = right_flanking;
}
return {
can_open: can_open,
can_close: can_close,
length: count
};
};
// re-export Token class to use in block rules
StateInline.prototype.Token = Token;
module.exports = StateInline;
/***/ }),
/***/ "./node_modules/markdown-it/lib/rules_inline/strikethrough.js":
/*!********************************************************************!*\
!*** ./node_modules/markdown-it/lib/rules_inline/strikethrough.js ***!
\********************************************************************/
/***/ ((module) => {
"use strict";
// ~~strike through~~
//
// Insert each marker as a separate text token, and add it to delimiter list
//
module.exports.tokenize = function strikethrough(state, silent) {
var i, scanned, token, len, ch,
start = state.pos,
marker = state.src.charCodeAt(start);
if (silent) { return false; }
if (marker !== 0x7E/* ~ */) { return false; }
scanned = state.scanDelims(state.pos, true);
len = scanned.length;
ch = String.fromCharCode(marker);
if (len < 2) { return false; }
if (len % 2) {
token = state.push('text', '', 0);
token.content = ch;
len--;
}
for (i = 0; i < len; i += 2) {
token = state.push('text', '', 0);
token.content = ch + ch;
state.delimiters.push({
marker: marker,
length: 0, // disable "rule of 3" length checks meant for emphasis
jump: i / 2, // for `~~` 1 marker = 2 characters
token: state.tokens.length - 1,
end: -1,
open: scanned.can_open,
close: scanned.can_close
});
}
state.pos += scanned.length;
return true;
};
function postProcess(state, delimiters) {
var i, j,
startDelim,
endDelim,
token,
loneMarkers = [],
max = delimiters.length;
for (i = 0; i < max; i++) {
startDelim = delimiters[i];
if (startDelim.marker !== 0x7E/* ~ */) {
continue;
}
if (startDelim.end === -1) {
continue;
}
endDelim = delimiters[startDelim.end];
token = state.tokens[startDelim.token];
token.type = 's_open';
token.tag = 's';
token.nesting = 1;
token.markup = '~~';
token.content = '';
token = state.tokens[endDelim.token];
token.type = 's_close';
token.tag = 's';
token.nesting = -1;
token.markup = '~~';
token.content = '';
if (state.tokens[endDelim.token - 1].type === 'text' &&
state.tokens[endDelim.token - 1].content === '~') {
loneMarkers.push(endDelim.token - 1);
}
}
// If a marker sequence has an odd number of characters, it's splitted
// like this: `~~~~~` -> `~` + `~~` + `~~`, leaving one marker at the
// start of the sequence.
//
// So, we have to move all those markers after subsequent s_close tags.
//
while (loneMarkers.length) {
i = loneMarkers.pop();
j = i + 1;
while (j < state.tokens.length && state.tokens[j].type === 's_close') {
j++;
}
j--;
if (i !== j) {
token = state.tokens[j];
state.tokens[j] = state.tokens[i];
state.tokens[i] = token;
}
}
}
// Walk through delimiter list and replace text tokens with tags
//
module.exports.postProcess = function strikethrough(state) {
var curr,
tokens_meta = state.tokens_meta,
max = state.tokens_meta.length;
postProcess(state, state.delimiters);
for (curr = 0; curr < max; curr++) {
if (tokens_meta[curr] && tokens_meta[curr].delimiters) {
postProcess(state, tokens_meta[curr].delimiters);
}
}
};
/***/ }),
/***/ "./node_modules/markdown-it/lib/rules_inline/text.js":
/*!***********************************************************!*\
!*** ./node_modules/markdown-it/lib/rules_inline/text.js ***!
\***********************************************************/
/***/ ((module) => {
"use strict";
// Skip text characters for text token, place those to pending buffer
// and increment current pos
// Rule to skip pure text
// '{}$%@~+=:' reserved for extentions
// !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \, ], ^, _, `, {, |, }, or ~
// !!!! Don't confuse with "Markdown ASCII Punctuation" chars
// http://spec.commonmark.org/0.15/#ascii-punctuation-character
function isTerminatorChar(ch) {
switch (ch) {
case 0x0A/* \n */:
case 0x21/* ! */:
case 0x23/* # */:
case 0x24/* $ */:
case 0x25/* % */:
case 0x26/* & */:
case 0x2A/* * */:
case 0x2B/* + */:
case 0x2D/* - */:
case 0x3A/* : */:
case 0x3C/* < */:
case 0x3D/* = */:
case 0x3E/* > */:
case 0x40/* @ */:
case 0x5B/* [ */:
case 0x5C/* \ */:
case 0x5D/* ] */:
case 0x5E/* ^ */:
case 0x5F/* _ */:
case 0x60/* ` */:
case 0x7B/* { */:
case 0x7D/* } */:
case 0x7E/* ~ */:
return true;
default:
return false;
}
}
module.exports = function text(state, silent) {
var pos = state.pos;
while (pos < state.posMax && !isTerminatorChar(state.src.charCodeAt(pos))) {
pos++;
}
if (pos === state.pos) { return false; }
if (!silent) { state.pending += state.src.slice(state.pos, pos); }
state.pos = pos;
return true;
};
// Alternative implementation, for memory.
//
// It costs 10% of performance, but allows extend terminators list, if place it
// to `ParcerInline` property. Probably, will switch to it sometime, such
// flexibility required.
/*
var TERMINATOR_RE = /[\n!#$%&*+\-:<=>@[\\\]^_`{}~]/;
module.exports = function text(state, silent) {
var pos = state.pos,
idx = state.src.slice(pos).search(TERMINATOR_RE);
// first char is terminator -> empty text
if (idx === 0) { return false; }
// no terminator -> text till end of string
if (idx < 0) {
if (!silent) { state.pending += state.src.slice(pos); }
state.pos = state.src.length;
return true;
}
if (!silent) { state.pending += state.src.slice(pos, pos + idx); }
state.pos += idx;
return true;
};*/
/***/ }),
/***/ "./node_modules/markdown-it/lib/rules_inline/text_collapse.js":
/*!********************************************************************!*\
!*** ./node_modules/markdown-it/lib/rules_inline/text_collapse.js ***!
\********************************************************************/
/***/ ((module) => {
"use strict";
// Clean up tokens after emphasis and strikethrough postprocessing:
// merge adjacent text nodes into one and re-calculate all token levels
//
// This is necessary because initially emphasis delimiter markers (*, _, ~)
// are treated as their own separate text tokens. Then emphasis rule either
// leaves them as text (needed to merge with adjacent text) or turns them
// into opening/closing tags (which messes up levels inside).
//
module.exports = function text_collapse(state) {
var curr, last,
level = 0,
tokens = state.tokens,
max = state.tokens.length;
for (curr = last = 0; curr < max; curr++) {
// re-calculate levels after emphasis/strikethrough turns some text nodes
// into opening/closing tags
if (tokens[curr].nesting < 0) level--; // closing tag
tokens[curr].level = level;
if (tokens[curr].nesting > 0) level++; // opening tag
if (tokens[curr].type === 'text' &&
curr + 1 < max &&
tokens[curr + 1].type === 'text') {
// collapse two adjacent text nodes
tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content;
} else {
if (curr !== last) { tokens[last] = tokens[curr]; }
last++;
}
}
if (curr !== last) {
tokens.length = last;
}
};
/***/ }),
/***/ "./node_modules/markdown-it/lib/token.js":
/*!***********************************************!*\
!*** ./node_modules/markdown-it/lib/token.js ***!
\***********************************************/
/***/ ((module) => {
"use strict";
// Token class
/**
* class Token
**/
/**
* new Token(type, tag, nesting)
*
* Create new token and fill passed properties.
**/
function Token(type, tag, nesting) {
/**
* Token#type -> String
*
* Type of the token (string, e.g. "paragraph_open")
**/
this.type = type;
/**
* Token#tag -> String
*
* html tag name, e.g. "p"
**/
this.tag = tag;
/**
* Token#attrs -> Array
*
* Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`
**/
this.attrs = null;
/**
* Token#map -> Array
*
* Source map info. Format: `[ line_begin, line_end ]`
**/
this.map = null;
/**
* Token#nesting -> Number
*
* Level change (number in {-1, 0, 1} set), where:
*
* - `1` means the tag is opening
* - `0` means the tag is self-closing
* - `-1` means the tag is closing
**/
this.nesting = nesting;
/**
* Token#level -> Number
*
* nesting level, the same as `state.level`
**/
this.level = 0;
/**
* Token#children -> Array
*
* An array of child nodes (inline and img tokens)
**/
this.children = null;
/**
* Token#content -> String
*
* In a case of self-closing tag (code, html, fence, etc.),
* it has contents of this tag.
**/
this.content = '';
/**
* Token#markup -> String
*
* '*' or '_' for emphasis, fence string for fence, etc.
**/
this.markup = '';
/**
* Token#info -> String
*
* Additional information:
*
* - Info string for "fence" tokens
* - The value "auto" for autolink "link_open" and "link_close" tokens
* - The string value of the item marker for ordered-list "list_item_open" tokens
**/
this.info = '';
/**
* Token#meta -> Object
*
* A place for plugins to store an arbitrary data
**/
this.meta = null;
/**
* Token#block -> Boolean
*
* True for block-level tokens, false for inline tokens.
* Used in renderer to calculate line breaks
**/
this.block = false;
/**
* Token#hidden -> Boolean
*
* If it's true, ignore this element when rendering. Used for tight lists
* to hide paragraphs.
**/
this.hidden = false;
}
/**
* Token.attrIndex(name) -> Number
*
* Search attribute index by name.
**/
Token.prototype.attrIndex = function attrIndex(name) {
var attrs, i, len;
if (!this.attrs) { return -1; }
attrs = this.attrs;
for (i = 0, len = attrs.length; i < len; i++) {
if (attrs[i][0] === name) { return i; }
}
return -1;
};
/**
* Token.attrPush(attrData)
*
* Add `[ name, value ]` attribute to list. Init attrs if necessary
**/
Token.prototype.attrPush = function attrPush(attrData) {
if (this.attrs) {
this.attrs.push(attrData);
} else {
this.attrs = [ attrData ];
}
};
/**
* Token.attrSet(name, value)
*
* Set `name` attribute to `value`. Override old value if exists.
**/
Token.prototype.attrSet = function attrSet(name, value) {
var idx = this.attrIndex(name),
attrData = [ name, value ];
if (idx < 0) {
this.attrPush(attrData);
} else {
this.attrs[idx] = attrData;
}
};
/**
* Token.attrGet(name)
*
* Get the value of attribute `name`, or null if it does not exist.
**/
Token.prototype.attrGet = function attrGet(name) {
var idx = this.attrIndex(name), value = null;
if (idx >= 0) {
value = this.attrs[idx][1];
}
return value;
};
/**
* Token.attrJoin(name, value)
*
* Join value to existing attribute via space. Or create new attribute if not
* exists. Useful to operate with token classes.
**/
Token.prototype.attrJoin = function attrJoin(name, value) {
var idx = this.attrIndex(name);
if (idx < 0) {
this.attrPush([ name, value ]);
} else {
this.attrs[idx][1] = this.attrs[idx][1] + ' ' + value;
}
};
module.exports = Token;
/***/ }),
/***/ "./node_modules/mdurl/decode.js":
/*!**************************************!*\
!*** ./node_modules/mdurl/decode.js ***!
\**************************************/
/***/ ((module) => {
"use strict";
/* eslint-disable no-bitwise */
var decodeCache = {};
function getDecodeCache(exclude) {
var i, ch, cache = decodeCache[exclude];
if (cache) { return cache; }
cache = decodeCache[exclude] = [];
for (i = 0; i < 128; i++) {
ch = String.fromCharCode(i);
cache.push(ch);
}
for (i = 0; i < exclude.length; i++) {
ch = exclude.charCodeAt(i);
cache[ch] = '%' + ('0' + ch.toString(16).toUpperCase()).slice(-2);
}
return cache;
}
// Decode percent-encoded string.
//
function decode(string, exclude) {
var cache;
if (typeof exclude !== 'string') {
exclude = decode.defaultChars;
}
cache = getDecodeCache(exclude);
return string.replace(/(%[a-f0-9]{2})+/gi, function(seq) {
var i, l, b1, b2, b3, b4, chr,
result = '';
for (i = 0, l = seq.length; i < l; i += 3) {
b1 = parseInt(seq.slice(i + 1, i + 3), 16);
if (b1 < 0x80) {
result += cache[b1];
continue;
}
if ((b1 & 0xE0) === 0xC0 && (i + 3 < l)) {
// 110xxxxx 10xxxxxx
b2 = parseInt(seq.slice(i + 4, i + 6), 16);
if ((b2 & 0xC0) === 0x80) {
chr = ((b1 << 6) & 0x7C0) | (b2 & 0x3F);
if (chr < 0x80) {
result += '\ufffd\ufffd';
} else {
result += String.fromCharCode(chr);
}
i += 3;
continue;
}
}
if ((b1 & 0xF0) === 0xE0 && (i + 6 < l)) {
// 1110xxxx 10xxxxxx 10xxxxxx
b2 = parseInt(seq.slice(i + 4, i + 6), 16);
b3 = parseInt(seq.slice(i + 7, i + 9), 16);
if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80) {
chr = ((b1 << 12) & 0xF000) | ((b2 << 6) & 0xFC0) | (b3 & 0x3F);
if (chr < 0x800 || (chr >= 0xD800 && chr <= 0xDFFF)) {
result += '\ufffd\ufffd\ufffd';
} else {
result += String.fromCharCode(chr);
}
i += 6;
continue;
}
}
if ((b1 & 0xF8) === 0xF0 && (i + 9 < l)) {
// 111110xx 10xxxxxx 10xxxxxx 10xxxxxx
b2 = parseInt(seq.slice(i + 4, i + 6), 16);
b3 = parseInt(seq.slice(i + 7, i + 9), 16);
b4 = parseInt(seq.slice(i + 10, i + 12), 16);
if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80 && (b4 & 0xC0) === 0x80) {
chr = ((b1 << 18) & 0x1C0000) | ((b2 << 12) & 0x3F000) | ((b3 << 6) & 0xFC0) | (b4 & 0x3F);
if (chr < 0x10000 || chr > 0x10FFFF) {
result += '\ufffd\ufffd\ufffd\ufffd';
} else {
chr -= 0x10000;
result += String.fromCharCode(0xD800 + (chr >> 10), 0xDC00 + (chr & 0x3FF));
}
i += 9;
continue;
}
}
result += '\ufffd';
}
return result;
});
}
decode.defaultChars = ';/?:@&=+$,#';
decode.componentChars = '';
module.exports = decode;
/***/ }),
/***/ "./node_modules/mdurl/encode.js":
/*!**************************************!*\
!*** ./node_modules/mdurl/encode.js ***!
\**************************************/
/***/ ((module) => {
"use strict";
var encodeCache = {};
// Create a lookup array where anything but characters in `chars` string
// and alphanumeric chars is percent-encoded.
//
function getEncodeCache(exclude) {
var i, ch, cache = encodeCache[exclude];
if (cache) { return cache; }
cache = encodeCache[exclude] = [];
for (i = 0; i < 128; i++) {
ch = String.fromCharCode(i);
if (/^[0-9a-z]$/i.test(ch)) {
// always allow unencoded alphanumeric characters
cache.push(ch);
} else {
cache.push('%' + ('0' + i.toString(16).toUpperCase()).slice(-2));
}
}
for (i = 0; i < exclude.length; i++) {
cache[exclude.charCodeAt(i)] = exclude[i];
}
return cache;
}
// Encode unsafe characters with percent-encoding, skipping already
// encoded sequences.
//
// - string - string to encode
// - exclude - list of characters to ignore (in addition to a-zA-Z0-9)
// - keepEscaped - don't encode '%' in a correct escape sequence (default: true)
//
function encode(string, exclude, keepEscaped) {
var i, l, code, nextCode, cache,
result = '';
if (typeof exclude !== 'string') {
// encode(string, keepEscaped)
keepEscaped = exclude;
exclude = encode.defaultChars;
}
if (typeof keepEscaped === 'undefined') {
keepEscaped = true;
}
cache = getEncodeCache(exclude);
for (i = 0, l = string.length; i < l; i++) {
code = string.charCodeAt(i);
if (keepEscaped && code === 0x25 /* % */ && i + 2 < l) {
if (/^[0-9a-f]{2}$/i.test(string.slice(i + 1, i + 3))) {
result += string.slice(i, i + 3);
i += 2;
continue;
}
}
if (code < 128) {
result += cache[code];
continue;
}
if (code >= 0xD800 && code <= 0xDFFF) {
if (code >= 0xD800 && code <= 0xDBFF && i + 1 < l) {
nextCode = string.charCodeAt(i + 1);
if (nextCode >= 0xDC00 && nextCode <= 0xDFFF) {
result += encodeURIComponent(string[i] + string[i + 1]);
i++;
continue;
}
}
result += '%EF%BF%BD';
continue;
}
result += encodeURIComponent(string[i]);
}
return result;
}
encode.defaultChars = ";/?:@&=+$,-_.!~*'()#";
encode.componentChars = "-_.!~*'()";
module.exports = encode;
/***/ }),
/***/ "./node_modules/mdurl/format.js":
/*!**************************************!*\
!*** ./node_modules/mdurl/format.js ***!
\**************************************/
/***/ ((module) => {
"use strict";
module.exports = function format(url) {
var result = '';
result += url.protocol || '';
result += url.slashes ? '//' : '';
result += url.auth ? url.auth + '@' : '';
if (url.hostname && url.hostname.indexOf(':') !== -1) {
// ipv6 address
result += '[' + url.hostname + ']';
} else {
result += url.hostname || '';
}
result += url.port ? ':' + url.port : '';
result += url.pathname || '';
result += url.search || '';
result += url.hash || '';
return result;
};
/***/ }),
/***/ "./node_modules/mdurl/index.js":
/*!*************************************!*\
!*** ./node_modules/mdurl/index.js ***!
\*************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
module.exports.encode = __webpack_require__(/*! ./encode */ "./node_modules/mdurl/encode.js");
module.exports.decode = __webpack_require__(/*! ./decode */ "./node_modules/mdurl/decode.js");
module.exports.format = __webpack_require__(/*! ./format */ "./node_modules/mdurl/format.js");
module.exports.parse = __webpack_require__(/*! ./parse */ "./node_modules/mdurl/parse.js");
/***/ }),
/***/ "./node_modules/mdurl/parse.js":
/*!*************************************!*\
!*** ./node_modules/mdurl/parse.js ***!
\*************************************/
/***/ ((module) => {
"use strict";
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// Changes from joyent/node:
//
// 1. No leading slash in paths,
// e.g. in `url.parse('http://foo?bar')` pathname is ``, not `/`
//
// 2. Backslashes are not replaced with slashes,
// so `http:\\example.org\` is treated like a relative path
//
// 3. Trailing colon is treated like a part of the path,
// i.e. in `http://example.org:foo` pathname is `:foo`
//
// 4. Nothing is URL-encoded in the resulting object,
// (in joyent/node some chars in auth and paths are encoded)
//
// 5. `url.parse()` does not have `parseQueryString` argument
//
// 6. Removed extraneous result properties: `host`, `path`, `query`, etc.,
// which can be constructed using other parts of the url.
//
function Url() {
this.protocol = null;
this.slashes = null;
this.auth = null;
this.port = null;
this.hostname = null;
this.hash = null;
this.search = null;
this.pathname = null;
}
// Reference: RFC 3986, RFC 1808, RFC 2396
// define these here so at least they only have to be
// compiled once on the first module load.
var protocolPattern = /^([a-z0-9.+-]+:)/i,
portPattern = /:[0-9]*$/,
// Special case for a simple path URL
simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
// RFC 2396: characters reserved for delimiting URLs.
// We actually just auto-escape these.
delims = [ '<', '>', '"', '`', ' ', '\r', '\n', '\t' ],
// RFC 2396: characters not allowed for various reasons.
unwise = [ '{', '}', '|', '\\', '^', '`' ].concat(delims),
// Allowed by RFCs, but cause of XSS attacks. Always escape these.
autoEscape = [ '\'' ].concat(unwise),
// Characters that are never ever allowed in a hostname.
// Note that any invalid chars are also handled, but these
// are the ones that are *expected* to be seen, so we fast-path
// them.
nonHostChars = [ '%', '/', '?', ';', '#' ].concat(autoEscape),
hostEndingChars = [ '/', '?', '#' ],
hostnameMaxLen = 255,
hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,
hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
// protocols that can allow "unsafe" and "unwise" chars.
/* eslint-disable no-script-url */
// protocols that never have a hostname.
hostlessProtocol = {
'javascript': true,
'javascript:': true
},
// protocols that always contain a // bit.
slashedProtocol = {
'http': true,
'https': true,
'ftp': true,
'gopher': true,
'file': true,
'http:': true,
'https:': true,
'ftp:': true,
'gopher:': true,
'file:': true
};
/* eslint-enable no-script-url */
function urlParse(url, slashesDenoteHost) {
if (url && url instanceof Url) { return url; }
var u = new Url();
u.parse(url, slashesDenoteHost);
return u;
}
Url.prototype.parse = function(url, slashesDenoteHost) {
var i, l, lowerProto, hec, slashes,
rest = url;
// trim before proceeding.
// This is to support parse stuff like " http://foo.com \n"
rest = rest.trim();
if (!slashesDenoteHost && url.split('#').length === 1) {
// Try fast path regexp
var simplePath = simplePathPattern.exec(rest);
if (simplePath) {
this.pathname = simplePath[1];
if (simplePath[2]) {
this.search = simplePath[2];
}
return this;
}
}
var proto = protocolPattern.exec(rest);
if (proto) {
proto = proto[0];
lowerProto = proto.toLowerCase();
this.protocol = proto;
rest = rest.substr(proto.length);
}
// figure out if it's got a host
// user@server is *always* interpreted as a hostname, and url
// resolution will treat //foo/bar as host=foo,path=bar because that's
// how the browser resolves relative URLs.
if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) {
slashes = rest.substr(0, 2) === '//';
if (slashes && !(proto && hostlessProtocol[proto])) {
rest = rest.substr(2);
this.slashes = true;
}
}
if (!hostlessProtocol[proto] &&
(slashes || (proto && !slashedProtocol[proto]))) {
// there's a hostname.
// the first instance of /, ?, ;, or # ends the host.
//
// If there is an @ in the hostname, then non-host chars *are* allowed
// to the left of the last @ sign, unless some host-ending character
// comes *before* the @-sign.
// URLs are obnoxious.
//
// ex:
// http://a@b@c/ => user:a@b host:c
// http://a@b?@c => user:a host:c path:/?@c
// v0.12 TODO(isaacs): This is not quite how Chrome does things.
// Review our test case against browsers more comprehensively.
// find the first instance of any hostEndingChars
var hostEnd = -1;
for (i = 0; i < hostEndingChars.length; i++) {
hec = rest.indexOf(hostEndingChars[i]);
if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {
hostEnd = hec;
}
}
// at this point, either we have an explicit point where the
// auth portion cannot go past, or the last @ char is the decider.
var auth, atSign;
if (hostEnd === -1) {
// atSign can be anywhere.
atSign = rest.lastIndexOf('@');
} else {
// atSign must be in auth portion.
// http://a@b/c@d => host:b auth:a path:/c@d
atSign = rest.lastIndexOf('@', hostEnd);
}
// Now we have a portion which is definitely the auth.
// Pull that off.
if (atSign !== -1) {
auth = rest.slice(0, atSign);
rest = rest.slice(atSign + 1);
this.auth = auth;
}
// the host is the remaining to the left of the first non-host char
hostEnd = -1;
for (i = 0; i < nonHostChars.length; i++) {
hec = rest.indexOf(nonHostChars[i]);
if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {
hostEnd = hec;
}
}
// if we still have not hit it, then the entire thing is a host.
if (hostEnd === -1) {
hostEnd = rest.length;
}
if (rest[hostEnd - 1] === ':') { hostEnd--; }
var host = rest.slice(0, hostEnd);
rest = rest.slice(hostEnd);
// pull out port.
this.parseHost(host);
// we've indicated that there is a hostname,
// so even if it's empty, it has to be present.
this.hostname = this.hostname || '';
// if hostname begins with [ and ends with ]
// assume that it's an IPv6 address.
var ipv6Hostname = this.hostname[0] === '[' &&
this.hostname[this.hostname.length - 1] === ']';
// validate a little.
if (!ipv6Hostname) {
var hostparts = this.hostname.split(/\./);
for (i = 0, l = hostparts.length; i < l; i++) {
var part = hostparts[i];
if (!part) { continue; }
if (!part.match(hostnamePartPattern)) {
var newpart = '';
for (var j = 0, k = part.length; j < k; j++) {
if (part.charCodeAt(j) > 127) {
// we replace non-ASCII char with a temporary placeholder
// we need this to make sure size of hostname is not
// broken by replacing non-ASCII by nothing
newpart += 'x';
} else {
newpart += part[j];
}
}
// we test again with ASCII char only
if (!newpart.match(hostnamePartPattern)) {
var validParts = hostparts.slice(0, i);
var notHost = hostparts.slice(i + 1);
var bit = part.match(hostnamePartStart);
if (bit) {
validParts.push(bit[1]);
notHost.unshift(bit[2]);
}
if (notHost.length) {
rest = notHost.join('.') + rest;
}
this.hostname = validParts.join('.');
break;
}
}
}
}
if (this.hostname.length > hostnameMaxLen) {
this.hostname = '';
}
// strip [ and ] from the hostname
// the host field still retains them, though
if (ipv6Hostname) {
this.hostname = this.hostname.substr(1, this.hostname.length - 2);
}
}
// chop off from the tail first.
var hash = rest.indexOf('#');
if (hash !== -1) {
// got a fragment string.
this.hash = rest.substr(hash);
rest = rest.slice(0, hash);
}
var qm = rest.indexOf('?');
if (qm !== -1) {
this.search = rest.substr(qm);
rest = rest.slice(0, qm);
}
if (rest) { this.pathname = rest; }
if (slashedProtocol[lowerProto] &&
this.hostname && !this.pathname) {
this.pathname = '';
}
return this;
};
Url.prototype.parseHost = function(host) {
var port = portPattern.exec(host);
if (port) {
port = port[0];
if (port !== ':') {
this.port = port.substr(1);
}
host = host.substr(0, host.length - port.length);
}
if (host) { this.hostname = host; }
};
module.exports = urlParse;
/***/ }),
/***/ "./node_modules/queue/index.js":
/*!*************************************!*\
!*** ./node_modules/queue/index.js ***!
\*************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits.js")
var EventEmitter = __webpack_require__(/*! events */ "events").EventEmitter
module.exports = Queue
module.exports.default = Queue
function Queue (options) {
if (!(this instanceof Queue)) {
return new Queue(options)
}
EventEmitter.call(this)
options = options || {}
this.concurrency = options.concurrency || Infinity
this.timeout = options.timeout || 0
this.autostart = options.autostart || false
this.results = options.results || null
this.pending = 0
this.session = 0
this.running = false
this.jobs = []
this.timers = {}
}
inherits(Queue, EventEmitter)
var arrayMethods = [
'pop',
'shift',
'indexOf',
'lastIndexOf'
]
arrayMethods.forEach(function (method) {
Queue.prototype[method] = function () {
return Array.prototype[method].apply(this.jobs, arguments)
}
})
Queue.prototype.slice = function (begin, end) {
this.jobs = this.jobs.slice(begin, end)
return this
}
Queue.prototype.reverse = function () {
this.jobs.reverse()
return this
}
var arrayAddMethods = [
'push',
'unshift',
'splice'
]
arrayAddMethods.forEach(function (method) {
Queue.prototype[method] = function () {
var methodResult = Array.prototype[method].apply(this.jobs, arguments)
if (this.autostart) {
this.start()
}
return methodResult
}
})
Object.defineProperty(Queue.prototype, 'length', {
get: function () {
return this.pending + this.jobs.length
}
})
Queue.prototype.start = function (cb) {
if (cb) {
callOnErrorOrEnd.call(this, cb)
}
this.running = true
if (this.pending >= this.concurrency) {
return
}
if (this.jobs.length === 0) {
if (this.pending === 0) {
done.call(this)
}
return
}
var self = this
var job = this.jobs.shift()
var once = true
var session = this.session
var timeoutId = null
var didTimeout = false
var resultIndex = null
var timeout = job.hasOwnProperty('timeout') ? job.timeout : this.timeout
function next (err, result) {
if (once && self.session === session) {
once = false
self.pending--
if (timeoutId !== null) {
delete self.timers[timeoutId]
clearTimeout(timeoutId)
}
if (err) {
self.emit('error', err, job)
} else if (didTimeout === false) {
if (resultIndex !== null) {
self.results[resultIndex] = Array.prototype.slice.call(arguments, 1)
}
self.emit('success', result, job)
}
if (self.session === session) {
if (self.pending === 0 && self.jobs.length === 0) {
done.call(self)
} else if (self.running) {
self.start()
}
}
}
}
if (timeout) {
timeoutId = setTimeout(function () {
didTimeout = true
if (self.listeners('timeout').length > 0) {
self.emit('timeout', next, job)
} else {
next()
}
}, timeout)
this.timers[timeoutId] = timeoutId
}
if (this.results) {
resultIndex = this.results.length
this.results[resultIndex] = null
}
this.pending++
self.emit('start', job)
var promise = job(next)
if (promise && promise.then && typeof promise.then === 'function') {
promise.then(function (result) {
return next(null, result)
}).catch(function (err) {
return next(err || true)
})
}
if (this.running && this.jobs.length > 0) {
this.start()
}
}
Queue.prototype.stop = function () {
this.running = false
}
Queue.prototype.end = function (err) {
clearTimers.call(this)
this.jobs.length = 0
this.pending = 0
done.call(this, err)
}
function clearTimers () {
for (var key in this.timers) {
var timeoutId = this.timers[key]
delete this.timers[key]
clearTimeout(timeoutId)
}
}
function callOnErrorOrEnd (cb) {
var self = this
this.on('error', onerror)
this.on('end', onend)
function onerror (err) { self.end(err) }
function onend (err) {
self.removeListener('error', onerror)
self.removeListener('end', onend)
cb(err, this.results)
}
}
function done (err) {
this.session++
this.running = false
this.emit('end', err)
}
/***/ }),
/***/ "./node_modules/string-similarity/src/index.js":
/*!*****************************************************!*\
!*** ./node_modules/string-similarity/src/index.js ***!
\*****************************************************/
/***/ ((module) => {
module.exports = {
compareTwoStrings:compareTwoStrings,
findBestMatch:findBestMatch
};
function compareTwoStrings(first, second) {
first = first.replace(/\s+/g, '')
second = second.replace(/\s+/g, '')
if (first === second) return 1; // identical or empty
if (first.length < 2 || second.length < 2) return 0; // if either is a 0-letter or 1-letter string
let firstBigrams = new Map();
for (let i = 0; i < first.length - 1; i++) {
const bigram = first.substring(i, i + 2);
const count = firstBigrams.has(bigram)
? firstBigrams.get(bigram) + 1
: 1;
firstBigrams.set(bigram, count);
};
let intersectionSize = 0;
for (let i = 0; i < second.length - 1; i++) {
const bigram = second.substring(i, i + 2);
const count = firstBigrams.has(bigram)
? firstBigrams.get(bigram)
: 0;
if (count > 0) {
firstBigrams.set(bigram, count - 1);
intersectionSize++;
}
}
return (2.0 * intersectionSize) / (first.length + second.length - 2);
}
function findBestMatch(mainString, targetStrings) {
if (!areArgsValid(mainString, targetStrings)) throw new Error('Bad arguments: First argument should be a string, second should be an array of strings');
const ratings = [];
let bestMatchIndex = 0;
for (let i = 0; i < targetStrings.length; i++) {
const currentTargetString = targetStrings[i];
const currentRating = compareTwoStrings(mainString, currentTargetString)
ratings.push({target: currentTargetString, rating: currentRating})
if (currentRating > ratings[bestMatchIndex].rating) {
bestMatchIndex = i
}
}
const bestMatch = ratings[bestMatchIndex]
return { ratings: ratings, bestMatch: bestMatch, bestMatchIndex: bestMatchIndex };
}
function areArgsValid(mainString, targetStrings) {
if (typeof mainString !== 'string') return false;
if (!Array.isArray(targetStrings)) return false;
if (!targetStrings.length) return false;
if (targetStrings.find( function (s) { return typeof s !== 'string'})) return false;
return true;
}
/***/ }),
/***/ "./src/completion.ts":
/*!***************************!*\
!*** ./src/completion.ts ***!
\***************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.activate = void 0;
const fs = __webpack_require__(/*! fs */ "fs");
const image_size_1 = __webpack_require__(/*! image-size */ "./node_modules/image-size/dist/index.js");
const path = __webpack_require__(/*! path */ "path");
const vscode_1 = __webpack_require__(/*! vscode */ "vscode");
const toc_1 = __webpack_require__(/*! ./toc */ "./src/toc.ts");
const contextCheck_1 = __webpack_require__(/*! ./util/contextCheck */ "./src/util/contextCheck.ts");
const generic_1 = __webpack_require__(/*! ./util/generic */ "./src/util/generic.ts");
function activate(context) {
context.subscriptions.push(vscode_1.languages.registerCompletionItemProvider(generic_1.Document_Selector_Markdown, new MdCompletionItemProvider(), '(', '\\', '/', '[', '#'));
}
exports.activate = activate;
class MdCompletionItemProvider {
constructor() {
// Suffixes explained:
// \cmd -> 0
// \cmd{$1} -> 1
// \cmd{$1}{$2} -> 2
//
// Use linebreak to mimic the structure of the KaTeX [Support Table](https://katex.org/docs/supported.html)
this.accents1 = [
'tilde', 'mathring',
'widetilde', 'overgroup',
'utilde', 'undergroup',
'acute', 'vec', 'Overrightarrow',
'bar', 'overleftarrow', 'overrightarrow',
'breve', 'underleftarrow', 'underrightarrow',
'check', 'overleftharpoon', 'overrightharpoon',
'dot', 'overleftrightarrow', 'overbrace',
'ddot', 'underleftrightarrow', 'underbrace',
'grave', 'overline', 'overlinesegment',
'hat', 'underline', 'underlinesegment',
'widehat', 'widecheck'
];
this.delimiters0 = [
'lparen', 'rparen', 'lceil', 'rceil', 'uparrow',
'lbrack', 'rbrack', 'lfloor', 'rfloor', 'downarrow',
'lbrace', 'rbrace', 'lmoustache', 'rmoustache', 'updownarrow',
'langle', 'rangle', 'lgroup', 'rgroup', 'Uparrow',
'vert', 'ulcorner', 'urcorner', 'Downarrow',
'Vert', 'llcorner', 'lrcorner', 'Updownarrow',
'lvert', 'rvert', 'lVert', 'rVert', 'backslash',
'lang', 'rang', 'lt', 'gt', 'llbracket', 'rrbracket', 'lBrace', 'rBrace'
];
this.delimeterSizing0 = [
'left', 'big', 'bigl', 'bigm', 'bigr',
'middle', 'Big', 'Bigl', 'Bigm', 'Bigr',
'right', 'bigg', 'biggl', 'biggm', 'biggr',
'Bigg', 'Biggl', 'Biggm', 'Biggr'
];
this.greekLetters0 = [
'Alpha', 'Beta', 'Gamma', 'Delta',
'Epsilon', 'Zeta', 'Eta', 'Theta',
'Iota', 'Kappa', 'Lambda', 'Mu',
'Nu', 'Xi', 'Omicron', 'Pi',
'Rho', 'Sigma', 'Tau', 'Upsilon',
'Phi', 'Chi', 'Psi', 'Omega',
'varGamma', 'varDelta', 'varTheta', 'varLambda',
'varXi', 'varPi', 'varSigma', 'varUpsilon',
'varPhi', 'varPsi', 'varOmega',
'alpha', 'beta', 'gamma', 'delta',
'epsilon', 'zeta', 'eta', 'theta',
'iota', 'kappa', 'lambda', 'mu',
'nu', 'xi', 'omicron', 'pi',
'rho', 'sigma', 'tau', 'upsilon',
'phi', 'chi', 'psi', 'omega',
'varepsilon', 'varkappa', 'vartheta', 'thetasym',
'varpi', 'varrho', 'varsigma', 'varphi',
'digamma'
];
this.otherLetters0 = [
'imath', 'nabla', 'Im', 'Reals',
'jmath', 'partial', 'image', 'wp',
'aleph', 'Game', 'Bbbk', 'weierp',
'alef', 'Finv', 'N', 'Z',
'alefsym', 'cnums', 'natnums',
'beth', 'Complex', 'R',
'gimel', 'ell', 'Re',
'daleth', 'hbar', 'real',
'eth', 'hslash', 'reals'
];
this.annotation1 = [
'cancel', 'overbrace',
'bcancel', 'underbrace',
'xcancel', 'not =',
'sout', 'boxed',
'tag', 'tag*'
];
this.verticalLayout0 = ['atop'];
this.verticalLayout1 = ['substack'];
this.verticalLayout2 = ['stackrel', 'overset', 'underset', 'raisebox'];
this.overlap1 = ['mathllap', 'mathrlap', 'mathclap', 'llap', 'rlap', 'clap', 'smash'];
this.spacing0 = [
'thinspace', 'medspace', 'thickspace', 'enspace',
'quad', 'qquad', 'negthinspace', 'negmedspace',
'nobreakspace', 'negthickspace'
];
this.spacing1 = [
'kern', 'mkern', 'mskip', 'hskip',
'hspace', 'hspace*', 'phantom', 'hphantom', 'vphantom'
];
this.logicAndSetTheory0 = [
'forall', 'complement', 'therefore', 'emptyset',
'exists', 'subset', 'because', 'empty',
'exist', 'supset', 'mapsto', 'varnothing',
'nexists', 'mid', 'to', 'implies',
'in', 'land', 'gets', 'impliedby',
'isin', 'lor', 'leftrightarrow', 'iff',
'notin', 'ni', 'notni', 'neg', 'lnot'
];
this.macros0 = [
'def', 'gdef', 'edef', 'xdef', 'let', 'futurelet', 'global',
'newcommand', 'renewcommand', 'providecommand',
'long', 'char', 'mathchoice', 'TextOrMath',
'@ifstar', '@ifnextchar', '@firstoftwo', '@secondoftwo',
'relax', 'expandafter', 'noexpand'
];
this.bigOperators0 = [
'sum', 'prod', 'bigotimes', 'bigvee',
'int', 'coprod', 'bigoplus', 'bigwedge',
'iint', 'intop', 'bigodot', 'bigcap',
'iiint', 'smallint', 'biguplus', 'bigcup',
'oint', 'oiint', 'oiiint', 'bigsqcup'
];
this.binaryOperators0 = [
'cdot', 'gtrdot', 'pmod',
'cdotp', 'intercal', 'pod',
'centerdot', 'land', 'rhd',
'circ', 'leftthreetimes', 'rightthreetimes',
'amalg', 'circledast', 'ldotp', 'rtimes',
'And', 'circledcirc', 'lor', 'setminus',
'ast', 'circleddash', 'lessdot', 'smallsetminus',
'barwedge', 'Cup', 'lhd', 'sqcap',
'bigcirc', 'cup', 'ltimes', 'sqcup',
'bmod', 'curlyvee', 'times',
'boxdot', 'curlywedge', 'mp', 'unlhd',
'boxminus', 'div', 'odot', 'unrhd',
'boxplus', 'divideontimes', 'ominus', 'uplus',
'boxtimes', 'dotplus', 'oplus', 'vee',
'bullet', 'doublebarwedge', 'otimes', 'veebar',
'Cap', 'doublecap', 'oslash', 'wedge',
'cap', 'doublecup', 'pm', 'plusmn', 'wr'
];
this.fractions0 = ['over', 'above'];
this.fractions2 = ['frac', 'dfrac', 'tfrac', 'cfrac', 'genfrac'];
this.binomialCoefficients0 = ['choose'];
this.binomialCoefficients2 = ['binom', 'dbinom', 'tbinom', 'brace', 'brack'];
this.mathOperators0 = [
'arcsin', 'cotg', 'ln', 'det',
'arccos', 'coth', 'log', 'gcd',
'arctan', 'csc', 'sec', 'inf',
'arctg', 'ctg', 'sin', 'lim',
'arcctg', 'cth', 'sinh', 'liminf',
'arg', 'deg', 'sh', 'limsup',
'ch', 'dim', 'tan', 'max',
'cos', 'exp', 'tanh', 'min',
'cosec', 'hom', 'tg', 'Pr',
'cosh', 'ker', 'th', 'sup',
'cot', 'lg', 'argmax',
'argmin', 'limits'
];
this.mathOperators1 = ['operatorname'];
this.sqrt1 = ['sqrt'];
this.relations0 = [
'eqcirc', 'lesseqgtr', 'sqsupset',
'eqcolon', 'lesseqqgtr', 'sqsupseteq',
'Eqcolon', 'lessgtr', 'Subset',
'eqqcolon', 'lesssim', 'subset',
'approx', 'Eqqcolon', 'll', 'subseteq', 'sube',
'approxeq', 'eqsim', 'lll', 'subseteqq',
'asymp', 'eqslantgtr', 'llless', 'succ',
'backepsilon', 'eqslantless', 'lt', 'succapprox',
'backsim', 'equiv', 'mid', 'succcurlyeq',
'backsimeq', 'fallingdotseq', 'models', 'succeq',
'between', 'frown', 'multimap', 'succsim',
'bowtie', 'ge', 'owns', 'Supset',
'bumpeq', 'geq', 'parallel', 'supset',
'Bumpeq', 'geqq', 'perp', 'supseteq',
'circeq', 'geqslant', 'pitchfork', 'supseteqq',
'colonapprox', 'gg', 'prec', 'thickapprox',
'Colonapprox', 'ggg', 'precapprox', 'thicksim',
'coloneq', 'gggtr', 'preccurlyeq', 'trianglelefteq',
'Coloneq', 'gt', 'preceq', 'triangleq',
'coloneqq', 'gtrapprox', 'precsim', 'trianglerighteq',
'Coloneqq', 'gtreqless', 'propto', 'varpropto',
'colonsim', 'gtreqqless', 'risingdotseq', 'vartriangle',
'Colonsim', 'gtrless', 'shortmid', 'vartriangleleft',
'cong', 'gtrsim', 'shortparallel', 'vartriangleright',
'curlyeqprec', 'in', 'sim', 'vcentcolon',
'curlyeqsucc', 'Join', 'simeq', 'vdash',
'dashv', 'le', 'smallfrown', 'vDash',
'dblcolon', 'leq', 'smallsmile', 'Vdash',
'doteq', 'leqq', 'smile', 'Vvdash',
'Doteq', 'leqslant', 'sqsubset',
'doteqdot', 'lessapprox', 'sqsubseteq'
];
this.negatedRelations0 = [
'gnapprox', 'ngeqslant', 'nsubseteq', 'precneqq',
'gneq', 'ngtr', 'nsubseteqq', 'precnsim',
'gneqq', 'nleq', 'nsucc', 'subsetneq',
'gnsim', 'nleqq', 'nsucceq', 'subsetneqq',
'gvertneqq', 'nleqslant', 'nsupseteq', 'succnapprox',
'lnapprox', 'nless', 'nsupseteqq', 'succneqq',
'lneq', 'nmid', 'ntriangleleft', 'succnsim',
'lneqq', 'notin', 'ntrianglelefteq', 'supsetneq',
'lnsim', 'notni', 'ntriangleright', 'supsetneqq',
'lvertneqq', 'nparallel', 'ntrianglerighteq', 'varsubsetneq',
'ncong', 'nprec', 'nvdash', 'varsubsetneqq',
'ne', 'npreceq', 'nvDash', 'varsupsetneq',
'neq', 'nshortmid', 'nVDash', 'varsupsetneqq',
'ngeq', 'nshortparallel', 'nVdash',
'ngeqq', 'nsim', 'precnapprox'
];
this.arrows0 = [
'circlearrowleft', 'leftharpoonup', 'rArr',
'circlearrowright', 'leftleftarrows', 'rarr',
'curvearrowleft', 'leftrightarrow', 'restriction',
'curvearrowright', 'Leftrightarrow', 'rightarrow',
'Darr', 'leftrightarrows', 'Rightarrow',
'dArr', 'leftrightharpoons', 'rightarrowtail',
'darr', 'leftrightsquigarrow', 'rightharpoondown',
'dashleftarrow', 'Lleftarrow', 'rightharpoonup',
'dashrightarrow', 'longleftarrow', 'rightleftarrows',
'downarrow', 'Longleftarrow', 'rightleftharpoons',
'Downarrow', 'longleftrightarrow', 'rightrightarrows',
'downdownarrows', 'Longleftrightarrow', 'rightsquigarrow',
'downharpoonleft', 'longmapsto', 'Rrightarrow',
'downharpoonright', 'longrightarrow', 'Rsh',
'gets', 'Longrightarrow', 'searrow',
'Harr', 'looparrowleft', 'swarrow',
'hArr', 'looparrowright', 'to',
'harr', 'Lrarr', 'twoheadleftarrow',
'hookleftarrow', 'lrArr', 'twoheadrightarrow',
'hookrightarrow', 'lrarr', 'Uarr',
'iff', 'Lsh', 'uArr',
'impliedby', 'mapsto', 'uarr',
'implies', 'nearrow', 'uparrow',
'Larr', 'nleftarrow', 'Uparrow',
'lArr', 'nLeftarrow', 'updownarrow',
'larr', 'nleftrightarrow', 'Updownarrow',
'leadsto', 'nLeftrightarrow', 'upharpoonleft',
'leftarrow', 'nrightarrow', 'upharpoonright',
'Leftarrow', 'nRightarrow', 'upuparrows',
'leftarrowtail', 'nwarrow', 'leftharpoondown', 'Rarr'
];
this.extensibleArrows1 = [
'xleftarrow', 'xrightarrow',
'xLeftarrow', 'xRightarrow',
'xleftrightarrow', 'xLeftrightarrow',
'xhookleftarrow', 'xhookrightarrow',
'xtwoheadleftarrow', 'xtwoheadrightarrow',
'xleftharpoonup', 'xrightharpoonup',
'xleftharpoondown', 'xrightharpoondown',
'xleftrightharpoons', 'xrightleftharpoons',
'xtofrom', 'xmapsto',
'xlongequal'
];
this.braketNotation1 = ['bra', 'Bra', 'ket', 'Ket', 'braket'];
this.classAssignment1 = [
'mathbin', 'mathclose', 'mathinner', 'mathop',
'mathopen', 'mathord', 'mathpunct', 'mathrel'
];
this.color2 = ['color', 'textcolor', 'colorbox'];
this.font0 = ['rm', 'bf', 'it', 'sf', 'tt'];
this.font1 = [
'mathrm', 'mathbf', 'mathit',
'mathnormal', 'textbf', 'textit',
'textrm', 'bold', 'Bbb',
'textnormal', 'boldsymbol', 'mathbb',
'text', 'bm', 'frak',
'mathsf', 'mathtt', 'mathfrak',
'textsf', 'texttt', 'mathcal', 'mathscr'
];
this.size0 = [
'Huge', 'huge', 'LARGE', 'Large', 'large',
'normalsize', 'small', 'footnotesize', 'scriptsize', 'tiny'
];
this.style0 = [
'displaystyle', 'textstyle', 'scriptstyle', 'scriptscriptstyle',
'limits', 'nolimits', 'verb'
];
this.symbolsAndPunctuation0 = [
'cdots', 'LaTeX',
'ddots', 'TeX',
'ldots', 'nabla',
'vdots', 'infty',
'dotsb', 'infin',
'dotsc', 'checkmark',
'dotsi', 'dag',
'dotsm', 'dagger',
'dotso',
'sdot', 'ddag',
'mathellipsis', 'ddagger',
'Box', 'Dagger',
'lq', 'square', 'angle',
'blacksquare', 'measuredangle',
'rq', 'triangle', 'sphericalangle',
'triangledown', 'top',
'triangleleft', 'bot',
'triangleright',
'colon', 'bigtriangledown',
'backprime', 'bigtriangleup', 'pounds',
'prime', 'blacktriangle', 'mathsterling',
'blacktriangledown',
'blacktriangleleft', 'yen',
'blacktriangleright', 'surd',
'diamond', 'degree',
'Diamond',
'lozenge', 'mho',
'blacklozenge', 'diagdown',
'star', 'diagup',
'bigstar', 'flat',
'clubsuit', 'natural',
'copyright', 'clubs', 'sharp',
'circledR', 'diamondsuit', 'heartsuit',
'diamonds', 'hearts',
'circledS', 'spadesuit', 'spades',
'maltese', 'minuso'
];
this.debugging0 = ['message', 'errmessage', 'show'];
this.envs = [
'matrix', 'array',
'pmatrix', 'bmatrix',
'vmatrix', 'Vmatrix',
'Bmatrix',
'cases', 'rcases',
'smallmatrix', 'subarray',
'equation', 'split', 'align',
'gather', 'alignat',
'CD',
'darray', 'dcases', 'drcases',
'matrix*', 'pmatrix*', 'bmatrix*',
'Bmatrix*', 'vmatrix*', 'Vmatrix*',
'equation*', 'gather*', 'align*', 'alignat*',
'gathered', 'aligned', 'alignedat'
];
// \cmd
let c1 = Array.from(new Set([
...this.delimiters0, ...this.delimeterSizing0,
...this.greekLetters0, ...this.otherLetters0,
...this.spacing0, ...this.verticalLayout0,
...this.logicAndSetTheory0, ...this.macros0, ...this.bigOperators0,
...this.binaryOperators0, ...this.binomialCoefficients0,
...this.fractions0, ...this.mathOperators0,
...this.relations0, ...this.negatedRelations0,
...this.arrows0, ...this.font0, ...this.size0,
...this.style0, ...this.symbolsAndPunctuation0,
...this.debugging0
])).map(cmd => {
let item = new vscode_1.CompletionItem('\\' + cmd, vscode_1.CompletionItemKind.Function);
item.insertText = cmd;
return item;
});
// \cmd{$1}
let c2 = Array.from(new Set([
...this.accents1, ...this.annotation1,
...this.verticalLayout1, ...this.overlap1, ...this.spacing1,
...this.mathOperators1, ...this.sqrt1,
...this.extensibleArrows1, ...this.font1,
...this.braketNotation1, ...this.classAssignment1
])).map(cmd => {
let item = new vscode_1.CompletionItem('\\' + cmd, vscode_1.CompletionItemKind.Function);
item.insertText = new vscode_1.SnippetString(`${cmd}\{$1\}`);
return item;
});
// \cmd{$1}{$2}
let c3 = Array.from(new Set([
...this.verticalLayout2, ...this.binomialCoefficients2,
...this.fractions2, ...this.color2
])).map(cmd => {
let item = new vscode_1.CompletionItem('\\' + cmd, vscode_1.CompletionItemKind.Function);
item.insertText = new vscode_1.SnippetString(`${cmd}\{$1\}\{$2\}`);
return item;
});
let envSnippet = new vscode_1.CompletionItem('\\begin', vscode_1.CompletionItemKind.Snippet);
envSnippet.insertText = new vscode_1.SnippetString('begin{${1|' + this.envs.join(',') + '|}}\n\t$2\n\\end{$1}');
// Pretend to support multi-workspacefolders
let resource = null;
if (vscode_1.workspace.workspaceFolders !== undefined && vscode_1.workspace.workspaceFolders.length > 0) {
resource = vscode_1.workspace.workspaceFolders[0].uri;
}
// Import macros from configurations
let configMacros = vscode_1.workspace.getConfiguration('markdown.extension.katex', resource).get('macros');
var macroItems = [];
for (const cmd of Object.keys(configMacros)) {
const expansion = configMacros[cmd];
let item = new vscode_1.CompletionItem(cmd, vscode_1.CompletionItemKind.Function);
// Find the number of arguments in the expansion
let numArgs = 0;
for (let i = 1; i < 10; i++) {
if (!expansion.includes(`#${i}`)) {
numArgs = i - 1;
break;
}
}
item.insertText = new vscode_1.SnippetString(cmd.slice(1) + [...Array(numArgs).keys()].map(i => `\{$${i + 1}\}`).join(""));
macroItems.push(item);
}
this.mathCompletions = [...c1, ...c2, ...c3, envSnippet, ...macroItems];
// Sort
this.mathCompletions.forEach(item => {
item.sortText = item.label.replace(/[a-zA-Z]/g, c => {
if (/[a-z]/.test(c)) {
return `0${c}`;
}
else {
return `1${c.toLowerCase()}`;
}
});
});
let excludePatterns = ['**/node_modules', '**/bower_components', '**/*.code-search'];
if (vscode_1.workspace.getConfiguration('markdown.extension.completion', resource).get('respectVscodeSearchExclude')) {
const configExclude = vscode_1.workspace.getConfiguration('search', resource).get('exclude');
for (const key of Object.keys(configExclude)) {
if (configExclude[key] === true) {
excludePatterns.push(key);
}
}
}
excludePatterns = Array.from(new Set(excludePatterns));
this.EXCLUDE_GLOB = '{' + excludePatterns.join(',') + '}';
}
async provideCompletionItems(document, position, token, _context) {
const lineTextBefore = document.lineAt(position.line).text.substring(0, position.character);
const lineTextAfter = document.lineAt(position.line).text.substring(position.character);
let matches;
matches = lineTextBefore.match(/\\+$/);
if (/!\[[^\]]*?\]\([^\)]*$/.test(lineTextBefore) || /
]*src="[^"]*$/.test(lineTextBefore)) {
/* ┌─────────────┐
│ Image paths │
└─────────────┘ */
if (vscode_1.workspace.getWorkspaceFolder(document.uri) === undefined)
return [];
//// 🤔 better name?
let typedDir;
if (/!\[[^\]]*?\]\([^\)]*$/.test(lineTextBefore)) {
//// ``
typedDir = lineTextBefore.substr(lineTextBefore.lastIndexOf('](') + 2);
}
else {
//// `
`
typedDir = lineTextBefore.substr(lineTextBefore.lastIndexOf('="') + 2);
}
const basePath = getBasepath(document, typedDir);
const isRootedPath = typedDir.startsWith('/');
return vscode_1.workspace.findFiles('**/*.{png,jpg,jpeg,svg,gif,webp}', this.EXCLUDE_GLOB).then(uris => {
let items = uris.map(imgUri => {
const label = path.relative(basePath, imgUri.fsPath).replace(/\\/g, '/');
let item = new vscode_1.CompletionItem(label.replace(/ /g, '%20'), vscode_1.CompletionItemKind.File);
//// Add image preview
let dimensions;
try {
dimensions = (0, image_size_1.default)(imgUri.fsPath);
}
catch (error) {
console.error(error);
return item;
}
const maxWidth = 318;
if (dimensions.width > maxWidth) {
dimensions.height = Number(dimensions.height * maxWidth / dimensions.width);
dimensions.width = maxWidth;
}
item.documentation = new vscode_1.MarkdownString(`}|width=${dimensions.width},height=${dimensions.height})`);
item.sortText = label.replace(/\./g, '{');
return item;
});
if (isRootedPath) {
return items.filter(item => !item.label.startsWith('..'));
}
else {
return items;
}
});
}
else if (
//// ends with an odd number of backslashes
(matches = lineTextBefore.match(/\\+$/)) !== null
&& matches[0].length % 2 !== 0) {
/* ┌────────────────┐
│ Math functions │
└────────────────┘ */
if ((0, contextCheck_1.mathEnvCheck)(document, position) === "") {
return [];
}
else {
return this.mathCompletions;
}
}
else if (/\[[^\[\]]*$/.test(lineTextBefore)) {
/* ┌───────────────────────┐
│ Reference link labels │
└───────────────────────┘ */
const RXlookbehind = String.raw `(?<=(^[>]? {0,3}\[[ \t\r\n\f\v]*))`; // newline, not quoted, max 3 spaces, open [
const RXlinklabel = String.raw `(?([^\]]|(\\\]))*)`; // string for linklabel, allows for /] in linklabel
const RXlink = String.raw `(?((<[^>]*>)|([^< \t\r\n\f\v]+)))`; // link either or mylink
const RXlinktitle = String.raw `(?[ \t\r\n\f\v]+(("([^"]|(\\"))*")|('([^']|(\\'))*')))?$)`; // optional linktitle in "" or ''
const RXlookahead = String.raw `(?=(\]:[ \t\r\n\f\v]*` + // close linklabel with ]:
RXlink + RXlinktitle +
String.raw `)`; // end regex
const RXflags = String.raw `mg`; // multiline & global
// This pattern matches linklabels in link references definitions: [linklabel]: link "link title"
const pattern = new RegExp(RXlookbehind + RXlinklabel + RXlookahead, RXflags);
// TODO: may be extracted to a seperate function and used for all completions in the future.
const docText = document.getText();
/**
* NormalizedLabel (upper case) -> IReferenceDefinition
*/
const refDefinitions = new Map();
for (const match of docText.matchAll(pattern)) {
// Remove leading and trailing whitespace characters.
const label = match[0].replace(/^[ \t\r\n\f\v]+/, '').replace(/[ \t\r\n\f\v]+$/, '');
// For case-insensitive comparison.
const normalizedLabel = label.toUpperCase();
// The one that comes first in the document is used.
if (!refDefinitions.has(normalizedLabel)) {
refDefinitions.set(normalizedLabel, {
label,
usageCount: 0,
});
}
}
if (refDefinitions.size === 0 || token.isCancellationRequested) {
return;
}
// A confusing feature from #414. Not sure how to get it work.
const docLines = docText.split(/\r?\n/);
for (const crtLine of docLines) {
// Match something that may be a reference link.
const pattern = /\[([^\[\]]+?)\](?![(:\[])/g;
for (const match of crtLine.matchAll(pattern)) {
const label = match[1];
const record = refDefinitions.get(label.toUpperCase());
if (record) {
record.usageCount++;
}
}
}
let startIndex = lineTextBefore.lastIndexOf('[');
const range = new vscode_1.Range(position.with({ character: startIndex + 1 }), position);
if (token.isCancellationRequested) {
return;
}
const completionItemList = Array.from(refDefinitions.values(), ref => {
const label = ref.label;
const item = new vscode_1.CompletionItem(label, vscode_1.CompletionItemKind.Reference);
const usages = ref.usageCount;
item.documentation = new vscode_1.MarkdownString(label);
item.detail = usages === 1 ? `1 usage` : `${usages} usages`;
// Prefer unused items.
item.sortText = usages === 0 ? `0-${label}` : `1-${label}`;
item.range = range;
return item;
});
return completionItemList;
}
else if (/\[[^\[\]]*?\]\(#[^#\)]*$/.test(lineTextBefore)
|| /^>? {0,3}\[[^\[\]]+?\]\:[ \t\f\v]*#[^#]*$/.test(lineTextBefore)
// /\[[^\]]*\]\((\S*)#[^\)]*$/.test(lineTextBefore) // `[](url#anchor|` Link with anchor.
// || /\[[^\]]*\]\:\s?(\S*)#$/.test(lineTextBefore) // `[]: url#anchor|` Link reference definition with anchor.
) {
/* ┌───────────────────────────┐
│ Anchor tags from headings │
└───────────────────────────┘ */
let startIndex = lineTextBefore.lastIndexOf('#') - 1;
let isLinkRefDefinition = /^>? {0,3}\[[^\[\]]+?\]\:[ \t\f\v]*#[^#]*$/.test(lineTextBefore); // The same as the 2nd conditon above.
let endPosition = position;
let addClosingParen = false;
if (/^([^\) ]+\s*|^\s*)\)/.test(lineTextAfter)) {
// try to detect if user wants to replace a link (i.e. matching closing paren and )
// Either: ... something )
// or: ... )
// or: ... ) (endPosition assignment is a no-op for this case)
// in every case, we want to remove all characters after the cursor and before that first closing paren
endPosition = position.with({ character: +endPosition.character + lineTextAfter.indexOf(')') });
}
else {
// If no closing paren is found, replace all trailing non-white-space chars and add a closing paren
// distance to first non-whitespace or EOL
const toReplace = (lineTextAfter.search(/(?<=^\S+)(\s|$)/));
endPosition = position.with({ character: +endPosition.character + toReplace });
if (!isLinkRefDefinition) {
addClosingParen = true;
}
}
const range = new vscode_1.Range(position.with({ character: startIndex + 1 }), endPosition);
return new Promise((res, _) => {
//// let linkedDocument: TextDocument;
//// let urlString = lineTextBefore.match(/(?<=[\(|\:\s])\S*(?=\#)/)![0];
//// if (urlString) {
//// /* If the anchor is in a seperate file then the link is of the form:
//// "[linkLabel](urlString#MyAnchor)" or "[linkLabel]: urlString#MyAnchor"
//// If urlString is a ".md" or ".markdown" file and accessible then we should (pseudo code):
//// if (isAccessible(urlString)) {
//// linkedDocument = open(urlString)
//// } else {
//// return []
//// }
//// This has not been implemented yet so instead return with no completion for now. */
//// res(undefined); // remove when implementing anchor completion fron external file
//// } else {
//// /* else the anchor is in the current file and the link is of the form
//// "[linkLabel](#MyAnchor)"" or "[linkLabel]: #MyAnchor"
//// Then we should set linkedDocument = document */
//// linkedDocument = document;
//// }
const toc = (0, toc_1.getAllTocEntry)(document, { respectMagicCommentOmit: false, respectProjectLevelOmit: false });
const headingCompletions = toc.map(heading => {
const item = new vscode_1.CompletionItem('#' + heading.slug, vscode_1.CompletionItemKind.Reference);
if (addClosingParen) {
item.insertText = item.label + ')';
}
item.documentation = heading.rawContent;
item.range = range;
return item;
});
res(headingCompletions);
});
}
else if (/\[[^\[\]]*?\](?:(?:\([^\)]*)|(?:\:[ \t\f\v]*\S*))$/.test(lineTextBefore)) {
/* ┌────────────┐
│ File paths │
└────────────┘ */
//// Should be after anchor completions
if (vscode_1.workspace.getWorkspaceFolder(document.uri) === undefined)
return [];
const typedDir = lineTextBefore.match(/(?<=((?:\]\()|(?:\]\:))[ \t\f\v]*)\S*$/)[0];
const basePath = getBasepath(document, typedDir);
const isRootedPath = typedDir.startsWith('/');
return vscode_1.workspace.findFiles('**/*', this.EXCLUDE_GLOB).then(uris => {
let items = uris.map(uri => {
const label = path.relative(basePath, uri.fsPath).replace(/\\/g, '/').replace(/ /g, '%20');
let item = new vscode_1.CompletionItem(label, vscode_1.CompletionItemKind.File);
item.sortText = label.replace(/\./g, '{');
return item;
});
if (isRootedPath) {
return items.filter(item => !item.label.startsWith('..'));
}
else {
return items;
}
});
}
else {
return [];
}
}
}
/**
* @param doc
* @param dir The dir already typed in the src field, e.g. `[alt text](dir_here|)`
*/
function getBasepath(doc, dir) {
if (dir.includes('/')) {
dir = dir.substr(0, dir.lastIndexOf('/') + 1);
}
else {
dir = '';
}
let root = vscode_1.workspace.getWorkspaceFolder(doc.uri).uri.fsPath;
const rootFolder = vscode_1.workspace.getConfiguration('markdown.extension.completion', doc.uri).get('root', '');
if (rootFolder.length > 0 && fs.existsSync(path.join(root, rootFolder))) {
root = path.join(root, rootFolder);
}
const basePath = path.join(dir.startsWith('/')
? root
: path.dirname(doc.uri.fsPath), dir);
return basePath;
}
/***/ }),
/***/ "./src/configuration/fallback.ts":
/*!***************************************!*\
!*** ./src/configuration/fallback.ts ***!
\***************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.Fallback_Map = exports.Deprecated_Keys = void 0;
const vscode = __webpack_require__(/*! vscode */ "vscode");
/**
* Configuration keys that are no longer supported,
* and will be removed in the next major version.
*/
exports.Deprecated_Keys = Object.freeze([
"syntax.decorations", //
]);
exports.Fallback_Map = Object.freeze({
"theming.decoration.renderCodeSpan": (scope) => {
const config = vscode.workspace.getConfiguration("markdown.extension", scope);
const old = config.get("syntax.decorations");
if (old === null || old === undefined) {
return config.get("theming.decoration.renderCodeSpan");
}
else {
return old;
}
},
"theming.decoration.renderStrikethrough": (scope) => {
const config = vscode.workspace.getConfiguration("markdown.extension", scope);
const old = config.get("syntax.decorations");
if (old === null || old === undefined) {
return config.get("theming.decoration.renderStrikethrough");
}
else {
return old;
}
},
});
/***/ }),
/***/ "./src/configuration/manager.ts":
/*!**************************************!*\
!*** ./src/configuration/manager.ts ***!
\**************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.configManager = void 0;
const vscode = __webpack_require__(/*! vscode */ "vscode");
const fallback_1 = __webpack_require__(/*! ./fallback */ "./src/configuration/fallback.ts");
/**
* This is currently just a proxy that helps mapping our configuration keys.
*/
class ConfigurationManager {
constructor(fallback, deprecatedKeys) {
this._fallback = Object.isFrozen(fallback) ? fallback : Object.freeze({ ...fallback });
this.showWarning(deprecatedKeys);
}
dispose() { }
/**
* Shows an error message for each deprecated key, to help user migrate.
* This is async to avoid blocking instance creation.
*/
async showWarning(deprecatedKeys) {
for (const key of deprecatedKeys) {
const value = vscode.workspace.getConfiguration("markdown.extension").get(key);
if (value !== undefined && value !== null) {
// We are not able to localize this string for now.
// Our NLS module needs to be configured before using, which is done in the extension entry point.
// This module may be directly or indirectly imported by the entry point.
// Thus, this module may be loaded before the NLS module is available.
vscode.window.showErrorMessage(`The setting 'markdown.extension.${key}' has been deprecated.`);
}
}
}
get(key, scope) {
const fallback = this._fallback[key];
if (fallback) {
return fallback(scope);
}
else {
return vscode.workspace.getConfiguration("markdown.extension", scope).get(key);
}
}
getByAbsolute(section, scope) {
if (section.startsWith("markdown.extension.")) {
return this.get(section.slice(19), scope);
}
else {
return vscode.workspace.getConfiguration(undefined, scope).get(section);
}
}
}
exports.configManager = new ConfigurationManager(fallback_1.Fallback_Map, fallback_1.Deprecated_Keys);
/***/ }),
/***/ "./src/formatting.ts":
/*!***************************!*\
!*** ./src/formatting.ts ***!
\***************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.isSingleLink = exports.activate = void 0;
const vscode_1 = __webpack_require__(/*! vscode */ "vscode");
const listEditing_1 = __webpack_require__(/*! ./listEditing */ "./src/listEditing.ts");
function activate(context) {
context.subscriptions.push(vscode_1.commands.registerCommand('markdown.extension.editing.toggleBold', toggleBold), vscode_1.commands.registerCommand('markdown.extension.editing.toggleItalic', toggleItalic), vscode_1.commands.registerCommand('markdown.extension.editing.toggleCodeSpan', toggleCodeSpan), vscode_1.commands.registerCommand('markdown.extension.editing.toggleStrikethrough', toggleStrikethrough), vscode_1.commands.registerCommand('markdown.extension.editing.toggleMath', () => toggleMath(transTable)), vscode_1.commands.registerCommand('markdown.extension.editing.toggleMathReverse', () => toggleMath(reverseTransTable)), vscode_1.commands.registerCommand('markdown.extension.editing.toggleHeadingUp', toggleHeadingUp), vscode_1.commands.registerCommand('markdown.extension.editing.toggleHeadingDown', toggleHeadingDown), vscode_1.commands.registerCommand('markdown.extension.editing.toggleList', toggleList), vscode_1.commands.registerCommand('markdown.extension.editing.toggleCodeBlock', toggleCodeBlock), vscode_1.commands.registerCommand('markdown.extension.editing.paste', paste), vscode_1.commands.registerCommand('markdown.extension.editing._wrapBy', args => styleByWrapping(args['before'], args['after'])));
}
exports.activate = activate;
/**
* Here we store Regexp to check if the text is the single link.
*/
const singleLinkRegex = createLinkRegex();
// Return Promise because need to chain operations in unit tests
function toggleBold() {
return styleByWrapping('**');
}
function toggleItalic() {
let indicator = vscode_1.workspace.getConfiguration('markdown.extension.italic').get('indicator');
return styleByWrapping(indicator);
}
function toggleCodeSpan() {
return styleByWrapping('`');
}
function toggleCodeBlock() {
let editor = vscode_1.window.activeTextEditor;
return editor.insertSnippet(new vscode_1.SnippetString('```$0\n$TM_SELECTED_TEXT\n```'));
}
function toggleStrikethrough() {
return styleByWrapping('~~');
}
async function toggleHeadingUp() {
let editor = vscode_1.window.activeTextEditor;
let lineIndex = editor.selection.active.line;
let lineText = editor.document.lineAt(lineIndex).text;
return await editor.edit((editBuilder) => {
if (!lineText.startsWith('#')) { // Not a heading
editBuilder.insert(new vscode_1.Position(lineIndex, 0), '# ');
}
else if (!lineText.startsWith('######')) { // Already a heading (but not level 6)
editBuilder.insert(new vscode_1.Position(lineIndex, 0), '#');
}
});
}
function toggleHeadingDown() {
let editor = vscode_1.window.activeTextEditor;
let lineIndex = editor.selection.active.line;
let lineText = editor.document.lineAt(lineIndex).text;
editor.edit((editBuilder) => {
if (lineText.startsWith('# ')) { // Heading level 1
editBuilder.delete(new vscode_1.Range(new vscode_1.Position(lineIndex, 0), new vscode_1.Position(lineIndex, 2)));
}
else if (lineText.startsWith('#')) { // Heading (but not level 1)
editBuilder.delete(new vscode_1.Range(new vscode_1.Position(lineIndex, 0), new vscode_1.Position(lineIndex, 1)));
}
});
}
var MathBlockState;
(function (MathBlockState) {
// State 1: not in any others states
MathBlockState[MathBlockState["NONE"] = 0] = "NONE";
// State 2: $|$
MathBlockState[MathBlockState["INLINE"] = 1] = "INLINE";
// State 3: $$ | $$
MathBlockState[MathBlockState["SINGLE_DISPLAYED"] = 2] = "SINGLE_DISPLAYED";
// State 4:
// $$
// |
// $$
MathBlockState[MathBlockState["MULTI_DISPLAYED"] = 3] = "MULTI_DISPLAYED";
})(MathBlockState || (MathBlockState = {}));
function getMathState(editor, cursor) {
if (getContext(editor, cursor, '$', '$') === '$|$') {
return MathBlockState.INLINE;
}
else if (getContext(editor, cursor, '$$ ', ' $$') === '$$ | $$') {
return MathBlockState.SINGLE_DISPLAYED;
}
else if (editor.document.lineAt(cursor.line).text === ''
&& cursor.line > 0
&& editor.document.lineAt(cursor.line - 1).text.endsWith('$$')
&& cursor.line < editor.document.lineCount - 1
&& editor.document.lineAt(cursor.line + 1).text.startsWith('$$')) {
return MathBlockState.MULTI_DISPLAYED;
}
else {
return MathBlockState.NONE;
}
}
/**
* Modify the document, change from `oldMathBlockState` to `newMathBlockState`.
* @param editor
* @param cursor
* @param oldMathBlockState
* @param newMathBlockState
*/
function setMathState(editor, cursor, oldMathBlockState, newMathBlockState) {
// Step 1: Delete old math block.
editor.edit(editBuilder => {
let rangeToBeDeleted;
switch (oldMathBlockState) {
case MathBlockState.NONE:
rangeToBeDeleted = new vscode_1.Range(cursor, cursor);
break;
case MathBlockState.INLINE:
rangeToBeDeleted = new vscode_1.Range(new vscode_1.Position(cursor.line, cursor.character - 1), new vscode_1.Position(cursor.line, cursor.character + 1));
break;
case MathBlockState.SINGLE_DISPLAYED:
rangeToBeDeleted = new vscode_1.Range(new vscode_1.Position(cursor.line, cursor.character - 3), new vscode_1.Position(cursor.line, cursor.character + 3));
break;
case MathBlockState.MULTI_DISPLAYED:
const startCharIndex = editor.document.lineAt(cursor.line - 1).text.length - 2;
rangeToBeDeleted = new vscode_1.Range(new vscode_1.Position(cursor.line - 1, startCharIndex), new vscode_1.Position(cursor.line + 1, 2));
break;
}
editBuilder.delete(rangeToBeDeleted);
}).then(() => {
// Step 2: Insert new math block.
editor.edit(editBuilder => {
let newCursor = editor.selection.active;
let stringToBeInserted;
switch (newMathBlockState) {
case MathBlockState.NONE:
stringToBeInserted = '';
break;
case MathBlockState.INLINE:
stringToBeInserted = '$$';
break;
case MathBlockState.SINGLE_DISPLAYED:
stringToBeInserted = '$$ $$';
break;
case MathBlockState.MULTI_DISPLAYED:
stringToBeInserted = '$$\n\n$$';
break;
}
editBuilder.insert(newCursor, stringToBeInserted);
}).then(() => {
// Step 3: Move cursor to the middle.
let newCursor = editor.selection.active;
let newPosition;
switch (newMathBlockState) {
case MathBlockState.NONE:
newPosition = newCursor;
break;
case MathBlockState.INLINE:
newPosition = newCursor.with(newCursor.line, newCursor.character - 1);
break;
case MathBlockState.SINGLE_DISPLAYED:
newPosition = newCursor.with(newCursor.line, newCursor.character - 3);
break;
case MathBlockState.MULTI_DISPLAYED:
newPosition = newCursor.with(newCursor.line - 1, 0);
break;
}
editor.selection = new vscode_1.Selection(newPosition, newPosition);
});
});
}
const transTable = [
MathBlockState.NONE,
MathBlockState.INLINE,
MathBlockState.MULTI_DISPLAYED,
MathBlockState.SINGLE_DISPLAYED
];
const reverseTransTable = new Array(...transTable).reverse();
function toggleMath(transTable) {
let editor = vscode_1.window.activeTextEditor;
if (!editor.selection.isEmpty)
return;
let cursor = editor.selection.active;
let oldMathBlockState = getMathState(editor, cursor);
let currentStateIndex = transTable.indexOf(oldMathBlockState);
setMathState(editor, cursor, oldMathBlockState, transTable[(currentStateIndex + 1) % transTable.length]);
}
function toggleList() {
const editor = vscode_1.window.activeTextEditor;
const doc = editor.document;
let batchEdit = new vscode_1.WorkspaceEdit();
editor.selections.forEach(selection => {
if (selection.isEmpty) {
toggleListSingleLine(doc, selection.active.line, batchEdit);
}
else {
for (let i = selection.start.line; i <= selection.end.line; i++) {
toggleListSingleLine(doc, i, batchEdit);
}
}
});
return vscode_1.workspace.applyEdit(batchEdit).then(() => (0, listEditing_1.fixMarker)());
}
function toggleListSingleLine(doc, line, wsEdit) {
const lineText = doc.lineAt(line).text;
const indentation = lineText.trim().length === 0 ? lineText.length : lineText.indexOf(lineText.trim());
const lineTextContent = lineText.substr(indentation);
if (lineTextContent.startsWith("- ")) {
wsEdit.replace(doc.uri, new vscode_1.Range(line, indentation, line, indentation + 2), "* ");
}
else if (lineTextContent.startsWith("* ")) {
wsEdit.replace(doc.uri, new vscode_1.Range(line, indentation, line, indentation + 2), "+ ");
}
else if (lineTextContent.startsWith("+ ")) {
wsEdit.replace(doc.uri, new vscode_1.Range(line, indentation, line, indentation + 2), "1. ");
}
else if (/^\d+\. /.test(lineTextContent)) {
const lenOfDigits = /^(\d+)\./.exec(lineText.trim())[1].length;
wsEdit.replace(doc.uri, new vscode_1.Range(line, indentation + lenOfDigits, line, indentation + lenOfDigits + 1), ")");
}
else if (/^\d+\) /.test(lineTextContent)) {
const lenOfDigits = /^(\d+)\)/.exec(lineText.trim())[1].length;
wsEdit.delete(doc.uri, new vscode_1.Range(line, indentation, line, indentation + lenOfDigits + 2));
}
else {
wsEdit.insert(doc.uri, new vscode_1.Position(line, indentation), "- ");
}
}
async function paste() {
const editor = vscode_1.window.activeTextEditor;
const selection = editor.selection;
if (selection.isSingleLine && !isSingleLink(editor.document.getText(selection))) {
const text = await vscode_1.env.clipboard.readText();
if (isSingleLink(text)) {
return vscode_1.commands.executeCommand("editor.action.insertSnippet", { "snippet": `[$TM_SELECTED_TEXT$0](${text})` });
}
}
return vscode_1.commands.executeCommand("editor.action.clipboardPasteAction");
}
/**
* Creates Regexp to check if the text is a link (further detailes in the isSingleLink() documentation).
*
* @return Regexp
*/
function createLinkRegex() {
// unicode letters range(must not be a raw string)
const ul = '\\u00a1-\\uffff';
// IP patterns
const ipv4_re = '(?:25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3}';
const ipv6_re = '\\[[0-9a-f:\\.]+\\]'; // simple regex (in django it is validated additionally)
// Host patterns
const hostname_re = '[a-z' + ul + '0-9](?:[a-z' + ul + '0-9-]{0,61}[a-z' + ul + '0-9])?';
// Max length for domain name labels is 63 characters per RFC 1034 sec. 3.1
const domain_re = '(?:\\.(?!-)[a-z' + ul + '0-9-]{1,63}(? (selection.start.line == pos.line && selection.start.character >= pos.character) ? s : 0)
.reduce((a, b) => a + b, 0);
if (selection.isEmpty) {
const context = getContext(editor, cursorPos, startPattern, endPattern);
// No selected text
if (startPattern === endPattern &&
["**", "*", "__", "_"].includes(startPattern) &&
context === `${startPattern}text|${endPattern}`) {
// `**text|**` to `**text**|`
let newCursorPos = cursorPos.with({ character: cursorPos.character + shift + endPattern.length });
newSelections[i] = new vscode_1.Selection(newCursorPos, newCursorPos);
continue;
}
else if (context === `${startPattern}|${endPattern}`) {
// `**|**` to `|`
let start = cursorPos.with({ character: cursorPos.character - startPattern.length });
let end = cursorPos.with({ character: cursorPos.character + endPattern.length });
wrapRange(editor, batchEdit, shifts, newSelections, i, shift, cursorPos, new vscode_1.Range(start, end), false, startPattern, endPattern);
}
else {
// Select word under cursor
let wordRange = editor.document.getWordRangeAtPosition(cursorPos);
if (wordRange == undefined) {
wordRange = selection;
}
// One special case: toggle strikethrough in task list
const currentTextLine = editor.document.lineAt(cursorPos.line);
if (startPattern === '~~' && /^\s*[\*\+\-] (\[[ x]\] )? */g.test(currentTextLine.text)) {
wordRange = currentTextLine.range.with(new vscode_1.Position(cursorPos.line, currentTextLine.text.match(/^\s*[\*\+\-] (\[[ x]\] )? */g)[0].length));
}
wrapRange(editor, batchEdit, shifts, newSelections, i, shift, cursorPos, wordRange, false, startPattern, endPattern);
}
}
else {
// Text selected
wrapRange(editor, batchEdit, shifts, newSelections, i, shift, cursorPos, selection, true, startPattern, endPattern);
}
}
return vscode_1.workspace.applyEdit(batchEdit).then(() => {
editor.selections = newSelections;
});
}
/**
* Add or remove `startPattern`/`endPattern` according to the context
* @param editor
* @param options The undo/redo behavior
* @param cursor cursor position
* @param range range to be replaced
* @param isSelected is this range selected
* @param startPtn
* @param endPtn
*/
function wrapRange(editor, wsEdit, shifts, newSelections, i, shift, cursor, range, isSelected, startPtn, endPtn) {
let text = editor.document.getText(range);
const prevSelection = newSelections[i];
const ptnLength = (startPtn + endPtn).length;
let newCursorPos = cursor.with({ character: cursor.character + shift });
let newSelection;
if (isWrapped(text, startPtn, endPtn)) {
// remove start/end patterns from range
wsEdit.replace(editor.document.uri, range, text.substr(startPtn.length, text.length - ptnLength));
shifts.push([range.end, -ptnLength]);
// Fix cursor position
if (!isSelected) {
if (!range.isEmpty) { // means quick styling
if (cursor.character == range.end.character) {
newCursorPos = cursor.with({ character: cursor.character + shift - ptnLength });
}
else {
newCursorPos = cursor.with({ character: cursor.character + shift - startPtn.length });
}
}
else { // means `**|**` -> `|`
newCursorPos = cursor.with({ character: cursor.character + shift + startPtn.length });
}
newSelection = new vscode_1.Selection(newCursorPos, newCursorPos);
}
else {
newSelection = new vscode_1.Selection(prevSelection.start.with({ character: prevSelection.start.character + shift }), prevSelection.end.with({ character: prevSelection.end.character + shift - ptnLength }));
}
}
else {
// add start/end patterns around range
wsEdit.replace(editor.document.uri, range, startPtn + text + endPtn);
shifts.push([range.end, ptnLength]);
// Fix cursor position
if (!isSelected) {
if (!range.isEmpty) { // means quick styling
if (cursor.character == range.end.character) {
newCursorPos = cursor.with({ character: cursor.character + shift + ptnLength });
}
else {
newCursorPos = cursor.with({ character: cursor.character + shift + startPtn.length });
}
}
else { // means `|` -> `**|**`
newCursorPos = cursor.with({ character: cursor.character + shift + startPtn.length });
}
newSelection = new vscode_1.Selection(newCursorPos, newCursorPos);
}
else {
newSelection = new vscode_1.Selection(prevSelection.start.with({ character: prevSelection.start.character + shift }), prevSelection.end.with({ character: prevSelection.end.character + shift + ptnLength }));
}
}
newSelections[i] = newSelection;
}
function isWrapped(text, startPattern, endPattern) {
return text.startsWith(startPattern) && text.endsWith(endPattern);
}
function getContext(editor, cursorPos, startPattern, endPattern) {
let startPositionCharacter = cursorPos.character - startPattern.length;
let endPositionCharacter = cursorPos.character + endPattern.length;
if (startPositionCharacter < 0) {
startPositionCharacter = 0;
}
let leftText = editor.document.getText(new vscode_1.Range(cursorPos.line, startPositionCharacter, cursorPos.line, cursorPos.character));
let rightText = editor.document.getText(new vscode_1.Range(cursorPos.line, cursorPos.character, cursorPos.line, endPositionCharacter));
if (rightText == endPattern) {
if (leftText == startPattern) {
return `${startPattern}|${endPattern}`;
}
else {
return `${startPattern}text|${endPattern}`;
}
}
return '|';
}
/***/ }),
/***/ "./src/listEditing.ts":
/*!****************************!*\
!*** ./src/listEditing.ts ***!
\****************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.deactivate = exports.fixMarker = exports.activate = void 0;
const vscode_1 = __webpack_require__(/*! vscode */ "vscode");
const contextCheck_1 = __webpack_require__(/*! ./util/contextCheck */ "./src/util/contextCheck.ts");
function activate(context) {
context.subscriptions.push(vscode_1.commands.registerCommand('markdown.extension.onEnterKey', onEnterKey), vscode_1.commands.registerCommand('markdown.extension.onCtrlEnterKey', () => { return onEnterKey('ctrl'); }), vscode_1.commands.registerCommand('markdown.extension.onShiftEnterKey', () => { return onEnterKey('shift'); }), vscode_1.commands.registerCommand('markdown.extension.onTabKey', onTabKey), vscode_1.commands.registerCommand('markdown.extension.onShiftTabKey', () => { return onTabKey('shift'); }), vscode_1.commands.registerCommand('markdown.extension.onBackspaceKey', onBackspaceKey), vscode_1.commands.registerCommand('markdown.extension.checkTaskList', checkTaskList), vscode_1.commands.registerCommand('markdown.extension.onMoveLineDown', onMoveLineDown), vscode_1.commands.registerCommand('markdown.extension.onMoveLineUp', onMoveLineUp), vscode_1.commands.registerCommand('markdown.extension.onCopyLineDown', onCopyLineDown), vscode_1.commands.registerCommand('markdown.extension.onCopyLineUp', onCopyLineUp), vscode_1.commands.registerCommand('markdown.extension.onIndentLines', onIndentLines), vscode_1.commands.registerCommand('markdown.extension.onOutdentLines', onOutdentLines));
}
exports.activate = activate;
// The commands here are only bound to keys with `when` clause containing `editorTextFocus && !editorReadonly`. (package.json)
// So we don't need to check whether `activeTextEditor` returns `undefined` in most cases.
function onEnterKey(modifiers) {
let editor = vscode_1.window.activeTextEditor;
let cursorPos = editor.selection.active;
let line = editor.document.lineAt(cursorPos.line);
let textBeforeCursor = line.text.substr(0, cursorPos.character);
let textAfterCursor = line.text.substr(cursorPos.character);
let lineBreakPos = cursorPos;
if (modifiers == 'ctrl') {
lineBreakPos = line.range.end;
}
if (modifiers == 'shift' || (0, contextCheck_1.isInFencedCodeBlock)(editor.document, cursorPos.line) || (0, contextCheck_1.mathEnvCheck)(editor.document, cursorPos)) {
return asNormal('enter', modifiers);
}
//// This is a possibility that the current line is a thematic break `
` (GitHub #785)
const lineTextNoSpace = line.text.replace(/\s/g, '');
if (lineTextNoSpace.length > 2
&& (lineTextNoSpace.replace(/\-/g, '').length === 0
|| lineTextNoSpace.replace(/\*/g, '').length === 0)) {
return asNormal('enter', modifiers);
}
//// If it's an empty list item, remove it
if (/^([-+*]|[0-9]+[.)])( +\[[ x]\])?$/.test(textBeforeCursor.trim()) && textAfterCursor.trim().length == 0) {
return editor.edit(editBuilder => {
editBuilder.delete(line.range);
editBuilder.insert(line.range.end, '\n');
}).then(() => {
editor.revealRange(editor.selection);
}).then(() => fixMarker(findNextMarkerLineNumber()));
}
let matches;
if (/^> /.test(textBeforeCursor)) {
// Block quotes
// Case 1: ending a blockquote if seeing 2 consecutive empty `>` lines
if (
// The current line is an empty line
line.text.replace(/[ \t]+$/, '') === '>') {
if (cursorPos.line === 0) {
return editor.edit(editorBuilder => {
editorBuilder.replace(new vscode_1.Range(new vscode_1.Position(0, 0), new vscode_1.Position(cursorPos.line, cursorPos.character)), '');
}).then(() => { editor.revealRange(editor.selection); });
}
else {
const prevLineText = editor.document.lineAt(cursorPos.line - 1).text;
if (prevLineText.replace(/[ \t]+$/, '') === '>') {
return editor.edit(editorBuilder => {
editorBuilder.replace(new vscode_1.Range(new vscode_1.Position(cursorPos.line - 1, 0), new vscode_1.Position(cursorPos.line, cursorPos.character)), '\n');
}).then(() => { editor.revealRange(editor.selection); });
}
}
}
// Case 2: `>` continuation
return editor.edit(editBuilder => {
editBuilder.insert(lineBreakPos, `\n> `);
}).then(() => {
// Fix cursor position
if (modifiers == 'ctrl' && !cursorPos.isEqual(lineBreakPos)) {
let newCursorPos = cursorPos.with(line.lineNumber + 1, 2);
editor.selection = new vscode_1.Selection(newCursorPos, newCursorPos);
}
}).then(() => { editor.revealRange(editor.selection); });
}
else if ((matches = /^(\s*[-+*] +(\[[ x]\] +)?)/.exec(textBeforeCursor)) !== null) {
// Unordered list
return editor.edit(editBuilder => {
editBuilder.insert(lineBreakPos, `\n${matches[1].replace('[x]', '[ ]')}`);
}).then(() => {
// Fix cursor position
if (modifiers == 'ctrl' && !cursorPos.isEqual(lineBreakPos)) {
let newCursorPos = cursorPos.with(line.lineNumber + 1, matches[1].length);
editor.selection = new vscode_1.Selection(newCursorPos, newCursorPos);
}
}).then(() => { editor.revealRange(editor.selection); });
}
else if ((matches = /^(\s*)([0-9]+)([.)])( +)((\[[ x]\] +)?)/.exec(textBeforeCursor)) !== null) {
// Ordered list
let config = vscode_1.workspace.getConfiguration('markdown.extension.orderedList').get('marker');
let marker = '1';
let leadingSpace = matches[1];
let previousMarker = matches[2];
let delimiter = matches[3];
let trailingSpace = matches[4];
let gfmCheckbox = matches[5].replace('[x]', '[ ]');
let textIndent = (previousMarker + delimiter + trailingSpace).length;
if (config == 'ordered') {
marker = String(Number(previousMarker) + 1);
}
// Add enough trailing spaces so that the text is aligned with the previous list item, but always keep at least one space
trailingSpace = " ".repeat(Math.max(1, textIndent - (marker + delimiter).length));
const toBeAdded = leadingSpace + marker + delimiter + trailingSpace + gfmCheckbox;
return editor.edit(editBuilder => {
editBuilder.insert(lineBreakPos, `\n${toBeAdded}`);
}, { undoStopBefore: true, undoStopAfter: false }).then(() => {
// Fix cursor position
if (modifiers == 'ctrl' && !cursorPos.isEqual(lineBreakPos)) {
let newCursorPos = cursorPos.with(line.lineNumber + 1, toBeAdded.length);
editor.selection = new vscode_1.Selection(newCursorPos, newCursorPos);
}
}).then(() => fixMarker()).then(() => { editor.revealRange(editor.selection); });
}
else {
return asNormal('enter', modifiers);
}
}
function onTabKey(modifiers) {
let editor = vscode_1.window.activeTextEditor;
let cursorPos = editor.selection.start;
let lineText = editor.document.lineAt(cursorPos.line).text;
if ((0, contextCheck_1.isInFencedCodeBlock)(editor.document, cursorPos.line) || (0, contextCheck_1.mathEnvCheck)(editor.document, cursorPos)) {
return asNormal('tab', modifiers);
}
let match = /^\s*([-+*]|[0-9]+[.)]) +(\[[ x]\] +)?/.exec(lineText);
if (match
&& (modifiers === 'shift'
|| !editor.selection.isEmpty
|| editor.selection.isEmpty && cursorPos.character <= match[0].length)) {
if (modifiers === 'shift') {
return outdent(editor).then(() => fixMarker());
}
else {
return indent(editor).then(() => fixMarker());
}
}
else {
return asNormal('tab', modifiers);
}
}
function onBackspaceKey() {
let editor = vscode_1.window.activeTextEditor;
let cursor = editor.selection.active;
let document = editor.document;
let textBeforeCursor = document.lineAt(cursor.line).text.substr(0, cursor.character);
if ((0, contextCheck_1.isInFencedCodeBlock)(document, cursor.line) || (0, contextCheck_1.mathEnvCheck)(editor.document, cursor)) {
return asNormal('backspace');
}
if (!editor.selection.isEmpty) {
return asNormal('backspace').then(() => fixMarker(findNextMarkerLineNumber()));
}
else if (/^\s+([-+*]|[0-9]+[.)]) $/.test(textBeforeCursor)) {
// e.g. textBeforeCursor === ` - `, ` 1. `
return outdent(editor).then(() => fixMarker());
}
else if (/^([-+*]|[0-9]+[.)]) $/.test(textBeforeCursor)) {
// e.g. textBeforeCursor === `- `, `1. `
return editor.edit(editBuilder => {
editBuilder.replace(new vscode_1.Range(cursor.with({ character: 0 }), cursor), ' '.repeat(textBeforeCursor.length));
}).then(() => fixMarker(findNextMarkerLineNumber()));
}
else if (/^\s*([-+*]|[0-9]+[.)]) +(\[[ x]\] )$/.test(textBeforeCursor)) {
// e.g. textBeforeCursor === `- [ ]`, `1. [x]`, ` - [x]`
return deleteRange(editor, new vscode_1.Range(cursor.with({ character: textBeforeCursor.length - 4 }), cursor)).then(() => fixMarker(findNextMarkerLineNumber()));
}
else {
return asNormal('backspace');
}
}
function asNormal(key, modifiers) {
switch (key) {
case 'enter':
if (modifiers === 'ctrl') {
return vscode_1.commands.executeCommand('editor.action.insertLineAfter');
}
else {
return vscode_1.commands.executeCommand('type', { source: 'keyboard', text: '\n' });
}
case 'tab':
if (modifiers === 'shift') {
return vscode_1.commands.executeCommand('editor.action.outdentLines');
}
else if (vscode_1.window.activeTextEditor.selection.isEmpty
&& vscode_1.workspace.getConfiguration('emmet').get('triggerExpansionOnTab')) {
return vscode_1.commands.executeCommand('editor.emmet.action.expandAbbreviation');
}
else {
return vscode_1.commands.executeCommand('tab');
}
case 'backspace':
return vscode_1.commands.executeCommand('deleteLeft');
}
}
/**
* If
*
* 1. it is not the first line
* 2. there is a Markdown list item before this line
*
* then indent the current line to align with the previous list item.
*/
function indent(editor) {
if (!editor) {
editor = vscode_1.window.activeTextEditor;
}
if (vscode_1.workspace.getConfiguration("markdown.extension.list", editor.document.uri).get("indentationSize") === "adaptive") {
try {
const selection = editor.selection;
const indentationSize = tryDetermineIndentationSize(editor, selection.start.line, editor.document.lineAt(selection.start.line).firstNonWhitespaceCharacterIndex);
let edit = new vscode_1.WorkspaceEdit();
for (let i = selection.start.line; i <= selection.end.line; i++) {
if (i === selection.end.line && !selection.isEmpty && selection.end.character === 0) {
break;
}
if (editor.document.lineAt(i).text.length !== 0) {
edit.insert(editor.document.uri, new vscode_1.Position(i, 0), ' '.repeat(indentationSize));
}
}
return vscode_1.workspace.applyEdit(edit);
}
catch (error) { }
}
return vscode_1.commands.executeCommand('editor.action.indentLines');
}
/**
* Similar to `indent`-function
*/
function outdent(editor) {
if (!editor) {
editor = vscode_1.window.activeTextEditor;
}
if (vscode_1.workspace.getConfiguration("markdown.extension.list", editor.document.uri).get("indentationSize") === "adaptive") {
try {
const selection = editor.selection;
const indentationSize = tryDetermineIndentationSize(editor, selection.start.line, editor.document.lineAt(selection.start.line).firstNonWhitespaceCharacterIndex);
let edit = new vscode_1.WorkspaceEdit();
for (let i = selection.start.line; i <= selection.end.line; i++) {
if (i === selection.end.line && !selection.isEmpty && selection.end.character === 0) {
break;
}
const lineText = editor.document.lineAt(i).text;
let maxOutdentSize;
if (lineText.trim().length === 0) {
maxOutdentSize = lineText.length;
}
else {
maxOutdentSize = editor.document.lineAt(i).firstNonWhitespaceCharacterIndex;
}
if (maxOutdentSize > 0) {
edit.delete(editor.document.uri, new vscode_1.Range(i, 0, i, Math.min(indentationSize, maxOutdentSize)));
}
}
return vscode_1.workspace.applyEdit(edit);
}
catch (error) { }
}
return vscode_1.commands.executeCommand('editor.action.outdentLines');
}
function tryDetermineIndentationSize(editor, line, currentIndentation) {
while (--line >= 0) {
const lineText = editor.document.lineAt(line).text;
let matches;
if ((matches = /^(\s*)(([-+*]|[0-9]+[.)]) +)(\[[ x]\] +)?/.exec(lineText)) !== null) {
if (matches[1].length <= currentIndentation) {
return matches[2].length;
}
}
}
throw "No previous Markdown list item";
}
/**
* Returns the line number of the next ordered list item starting either from
* the specified line or the beginning of the current selection.
*/
function findNextMarkerLineNumber(line) {
let editor = vscode_1.window.activeTextEditor;
if (line === undefined) {
// Use start.line instead of active.line so that we can find the first
// marker following either the cursor or the entire selected range
line = editor.selection.start.line;
}
while (line < editor.document.lineCount) {
const lineText = editor.document.lineAt(line).text;
if (lineText.startsWith('#')) {
// Don't go searching past any headings
return -1;
}
if (/^\s*[0-9]+[.)] +/.exec(lineText) !== null) {
return line;
}
line++;
}
return undefined;
}
/**
* Looks for the previous ordered list marker at the same indentation level
* and returns the marker number that should follow it.
*
* @returns the fixed marker number
*/
function lookUpwardForMarker(editor, line, currentIndentation) {
while (--line >= 0) {
const lineText = editor.document.lineAt(line).text;
let matches;
if ((matches = /^(\s*)(([0-9]+)[.)] +)/.exec(lineText)) !== null) {
let leadingSpace = matches[1];
let marker = matches[3];
if (leadingSpace.length === currentIndentation) {
return Number(marker) + 1;
}
else if ((!leadingSpace.includes('\t') && leadingSpace.length + matches[2].length <= currentIndentation)
|| leadingSpace.includes('\t') && leadingSpace.length + 1 <= currentIndentation) {
return 1;
}
}
else if ((matches = /^(\s*)\S/.exec(lineText)) !== null) {
if (matches[1].length <= currentIndentation) {
break;
}
}
}
return 1;
}
/**
* Fix ordered list marker *iteratively* starting from current line
*/
function fixMarker(line) {
if (!vscode_1.workspace.getConfiguration('markdown.extension.orderedList').get('autoRenumber'))
return;
if (vscode_1.workspace.getConfiguration('markdown.extension.orderedList').get('marker') == 'one')
return;
let editor = vscode_1.window.activeTextEditor;
if (line === undefined) {
// Use either the first line containing an ordered list marker within the selection or the active line
line = findNextMarkerLineNumber();
if (line === undefined || line > editor.selection.end.line) {
line = editor.selection.active.line;
}
}
if (line < 0 || editor.document.lineCount <= line) {
return;
}
let currentLineText = editor.document.lineAt(line).text;
let matches;
if ((matches = /^(\s*)([0-9]+)([.)])( +)/.exec(currentLineText)) !== null) { // ordered list
let leadingSpace = matches[1];
let marker = matches[2];
let delimiter = matches[3];
let trailingSpace = matches[4];
let fixedMarker = lookUpwardForMarker(editor, line, leadingSpace.length);
let listIndent = marker.length + delimiter.length + trailingSpace.length;
let fixedMarkerString = String(fixedMarker);
return editor.edit(editBuilder => {
if (marker === fixedMarkerString) {
return;
}
// Add enough trailing spaces so that the text is still aligned at the same indentation level as it was previously, but always keep at least one space
fixedMarkerString += delimiter + " ".repeat(Math.max(1, listIndent - (fixedMarkerString + delimiter).length));
editBuilder.replace(new vscode_1.Range(line, leadingSpace.length, line, leadingSpace.length + listIndent), fixedMarkerString);
}, { undoStopBefore: false, undoStopAfter: false }).then(() => {
let nextLine = line + 1;
let indentString = " ".repeat(listIndent);
while (editor.document.lineCount > nextLine) {
const nextLineText = editor.document.lineAt(nextLine).text;
if (/^\s*[0-9]+[.)] +/.test(nextLineText)) {
return fixMarker(nextLine);
}
else if (/^\s*$/.test(nextLineText)) {
nextLine++;
}
else if (listIndent <= 4 && !nextLineText.startsWith(indentString)) {
return;
}
else {
nextLine++;
}
}
});
}
}
exports.fixMarker = fixMarker;
function deleteRange(editor, range) {
return editor.edit(editBuilder => {
editBuilder.delete(range);
},
// We will enable undoStop after fixing markers
{ undoStopBefore: true, undoStopAfter: false });
}
function checkTaskList() {
// - Look into selections for lines that could be checked/unchecked.
// - The first matching line dictates the new state for all further lines.
// - I.e. if the first line is unchecked, only other unchecked lines will
// be considered, and vice versa.
let editor = vscode_1.window.activeTextEditor;
const uncheckedRegex = /^(\s*([-+*]|[0-9]+[.)]) +\[) \]/;
const checkedRegex = /^(\s*([-+*]|[0-9]+[.)]) +\[)x\]/;
let toBeToggled = []; // all spots that have an "[x]" resp. "[ ]" which should be toggled
let newState = undefined; // true = "x", false = " ", undefined = no matching lines
// go through all touched lines of all selections.
for (const selection of editor.selections) {
for (let i = selection.start.line; i <= selection.end.line; i++) {
const line = editor.document.lineAt(i);
const lineStart = line.range.start;
if (!selection.isSingleLine && (selection.start.isEqual(line.range.end) || selection.end.isEqual(line.range.start))) {
continue;
}
let matches;
if ((matches = uncheckedRegex.exec(line.text))
&& newState !== false) {
toBeToggled.push(lineStart.with({ character: matches[1].length }));
newState = true;
}
else if ((matches = checkedRegex.exec(line.text))
&& newState !== true) {
toBeToggled.push(lineStart.with({ character: matches[1].length }));
newState = false;
}
}
}
if (newState !== undefined) {
const newChar = newState ? 'x' : ' ';
return editor.edit(editBuilder => {
for (const pos of toBeToggled) {
let range = new vscode_1.Range(pos, pos.with({ character: pos.character + 1 }));
editBuilder.replace(range, newChar);
}
});
}
}
function onMoveLineUp() {
return vscode_1.commands.executeCommand('editor.action.moveLinesUpAction')
.then(() => fixMarker());
}
function onMoveLineDown() {
return vscode_1.commands.executeCommand('editor.action.moveLinesDownAction')
.then(() => fixMarker(findNextMarkerLineNumber(vscode_1.window.activeTextEditor.selection.start.line - 1)));
}
function onCopyLineUp() {
return vscode_1.commands.executeCommand('editor.action.copyLinesUpAction')
.then(() => fixMarker());
}
function onCopyLineDown() {
return vscode_1.commands.executeCommand('editor.action.copyLinesDownAction')
.then(() => fixMarker());
}
function onIndentLines() {
return indent().then(() => fixMarker());
}
function onOutdentLines() {
return outdent().then(() => fixMarker());
}
function deactivate() { }
exports.deactivate = deactivate;
/***/ }),
/***/ "./src/markdown-it-plugin-provider.ts":
/*!********************************************!*\
!*** ./src/markdown-it-plugin-provider.ts ***!
\********************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.extendMarkdownIt = void 0;
const manager_1 = __webpack_require__(/*! ./configuration/manager */ "./src/configuration/manager.ts");
const katexOptions = { throwOnError: false };
/**
* https://code.visualstudio.com/api/extension-guides/markdown-extension#adding-support-for-new-syntax-with-markdownit-plugins
*/
function extendMarkdownIt(md) {
md.use(__webpack_require__(/*! markdown-it-task-lists */ "./node_modules/markdown-it-task-lists/index.js"));
if (manager_1.configManager.get("math.enabled")) {
// We need side effects. (#521)
__webpack_require__(/*! katex/contrib/mhchem/mhchem */ "./node_modules/katex/contrib/mhchem/mhchem.js");
// Deep copy, as KaTeX needs a normal mutable object.
const macros = JSON.parse(JSON.stringify(manager_1.configManager.get("katex.macros")));
if (Object.keys(macros).length === 0) {
delete katexOptions["macros"];
}
else {
katexOptions["macros"] = macros;
}
md.use(__webpack_require__(/*! @neilsustc/markdown-it-katex */ "./node_modules/@neilsustc/markdown-it-katex/index.js"), katexOptions);
}
return md;
}
exports.extendMarkdownIt = extendMarkdownIt;
/***/ }),
/***/ "./src/markdownEngine.ts":
/*!*******************************!*\
!*** ./src/markdownEngine.ts ***!
\*******************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
////
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.commonMarkEngine = exports.mdEngine = void 0;
const vscode = __webpack_require__(/*! vscode */ "vscode");
const MarkdownIt = __webpack_require__(/*! markdown-it */ "./node_modules/markdown-it/index.js");
const Token = __webpack_require__(/*! markdown-it/lib/token */ "./node_modules/markdown-it/lib/token.js");
const slugify_1 = __webpack_require__(/*! ./util/slugify */ "./src/util/slugify.ts");
const markdownExtensions_1 = __webpack_require__(/*! ./markdownExtensions */ "./src/markdownExtensions.ts");
const markdown_it_plugin_provider_1 = __webpack_require__(/*! ./markdown-it-plugin-provider */ "./src/markdown-it-plugin-provider.ts");
/**
* A strict CommonMark only engine powered by `markdown-it`.
*/
class CommonMarkEngine {
constructor() {
this._documentTokenCache = new Map();
this._engine = new MarkdownIt('commonmark');
this._disposables = [
vscode.workspace.onDidCloseTextDocument(document => {
if (document.languageId === "markdown" /* Markdown */) {
this._documentTokenCache.delete(document);
}
}),
];
}
get engine() {
return this._engine;
}
dispose() {
// Unsubscribe event listeners.
for (const disposable of this._disposables) {
disposable.dispose();
}
this._disposables.length = 0;
}
getDocumentToken(document) {
// It's safe to be sync.
// In the worst case, concurrent calls lead to run `parse()` multiple times.
// Only performance regression. No data corruption.
const cache = this._documentTokenCache.get(document);
if (cache && cache.version === document.version) {
return cache;
}
else {
const env = Object.create(null);
const result = {
document,
env,
// Read the version before parsing, in case the document changes,
// so that we won't declare an old result as a new one.
version: document.version,
tokens: this._engine.parse(document.getText(), env),
};
this._documentTokenCache.set(document, result);
return result;
}
}
async getEngine() {
return this._engine;
}
}
class MarkdownEngine {
constructor() {
this._documentTokenCache = new Map();
/**
* This is used by `addNamedHeaders()`, and reset on each call to `render()`.
*/
this._slugCount = new Map();
this.contributionsProvider = (0, markdownExtensions_1.getMarkdownContributionProvider)();
this._disposables = [
vscode.workspace.onDidCloseTextDocument(document => {
if (document.languageId === "markdown" /* Markdown */) {
this._documentTokenCache.delete(document);
}
}),
this.contributionsProvider.onDidChangeContributions(() => {
this.newEngine().then((engine) => {
this._engine = engine;
});
}),
];
// Initialize an engine.
this.newEngine().then((engine) => {
this._engine = engine;
});
}
dispose() {
// Unsubscribe event listeners.
for (const disposable of this._disposables) {
disposable.dispose();
}
this._disposables.length = 0;
}
async getDocumentToken(document) {
const cache = this._documentTokenCache.get(document);
if (cache && cache.version === document.version) {
return cache;
}
else {
const env = Object.create(null);
const engine = await this.getEngine();
const result = {
document,
env,
version: document.version,
tokens: engine.parse(document.getText(), env),
};
this._documentTokenCache.set(document, result);
return result;
}
}
async getEngine() {
if (!this._engine) {
this._engine = await this.newEngine();
}
return this._engine;
}
async newEngine() {
let md;
const hljs = __webpack_require__(/*! highlight.js */ "./node_modules/highlight.js/lib/index.js");
md = new MarkdownIt({
html: true,
highlight: (str, lang) => {
if (lang && (lang = normalizeHighlightLang(lang)) && hljs.getLanguage(lang)) {
try {
return hljs.highlight(str, { language: lang, ignoreIllegals: true }).value;
}
catch { }
}
return ""; // Signal to markdown-it itself to handle it.
}
});
// contributions provided by this extension must be processed specially,
// since this extension may not finish activation when creating an engine.
(0, markdown_it_plugin_provider_1.extendMarkdownIt)(md);
if (!vscode.workspace.getConfiguration('markdown.extension.print').get('validateUrls', true)) {
md.validateLink = () => true;
}
this.addNamedHeaders(md);
for (const contribute of this.contributionsProvider.contributions) {
if (!contribute.extendMarkdownIt) {
continue;
}
// Skip the third-party Markdown extension, if it is broken or crashes.
try {
md = await contribute.extendMarkdownIt(md);
}
catch (err) {
// Use the multiple object overload, so that the console can output the error object in its own way, which usually keeps more details than `toString`.
console.warn(`[yzhang.markdown-all-in-one]:\nSkipped Markdown extension: ${contribute.extensionId}\nReason:`, err);
}
}
return md;
}
async render(text, config) {
const md = await this.getEngine();
md.set({
breaks: config.get('breaks', false),
linkify: config.get('linkify', true)
});
this._slugCount.clear();
return md.render(text);
}
/**
* Tweak the render rule for headings, to set anchor ID.
*/
addNamedHeaders(md) {
const originalHeadingOpen = md.renderer.rules.heading_open;
// Arrow function ensures that `this` is inherited from `addNamedHeaders`,
// so that we won't need `bind`, and save memory a little.
md.renderer.rules.heading_open = (tokens, idx, options, env, self) => {
const raw = tokens[idx + 1].content;
let slug = (0, slugify_1.slugify)(raw, { env });
let lastCount = this._slugCount.get(slug);
if (lastCount) {
lastCount++;
this._slugCount.set(slug, lastCount);
slug += '-' + lastCount;
}
else {
this._slugCount.set(slug, 0);
}
tokens[idx].attrs = [...(tokens[idx].attrs || []), ["id", slug]];
if (originalHeadingOpen) {
return originalHeadingOpen(tokens, idx, options, env, self);
}
else {
return self.renderToken(tokens, idx, options);
}
};
}
}
/**
* Tries to convert the identifier to a language name supported by Highlight.js.
*
* @see {@link https://github.com/highlightjs/highlight.js/blob/main/SUPPORTED_LANGUAGES.md}
*/
function normalizeHighlightLang(lang) {
switch (lang && lang.toLowerCase()) {
case 'tsx':
case 'typescriptreact':
return 'jsx';
case 'json5':
case 'jsonc':
return 'json';
case 'c#':
case 'csharp':
return 'cs';
default:
return lang;
}
}
/**
* This engine dynamically refreshes in the same way as VS Code's built-in Markdown preview.
*/
exports.mdEngine = new MarkdownEngine();
/**
* A strict CommonMark only engine instance.
*/
exports.commonMarkEngine = new CommonMarkEngine();
/***/ }),
/***/ "./src/markdownExtensions.ts":
/*!***********************************!*\
!*** ./src/markdownExtensions.ts ***!
\***********************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
// Reference to https://github.com/microsoft/vscode/blob/master/extensions/markdown-language-features/src/markdownExtensions.ts
// Note:
// Not all extensions are implemented correctly.
// Thus, we need to check redundantly when loading their contributions, typically in `resolveMarkdownContribution()`.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.getMarkdownContributionProvider = void 0;
const vscode = __webpack_require__(/*! vscode */ "vscode");
const lazy_1 = __webpack_require__(/*! ./util/lazy */ "./src/util/lazy.ts");
/**
* Extracts and wraps `extendMarkdownIt()` from the extension.
*
* @returns A function that will activate the extension and invoke its `extendMarkdownIt()`.
*/
function getContributedMarkdownItPlugin(extension) {
return async (md) => {
const exports = await extension.activate();
if (exports && exports.extendMarkdownIt) {
return exports.extendMarkdownIt(md);
}
return md;
};
}
/**
* Resolves absolute Uris of paths from the extension.
*
* @param paths The list of paths relative to the extension's root directory.
*
* @returns A list of resolved absolute Uris.
* `undefined` indicates error.
*/
function resolveExtensionResourceUris(extension, paths) {
try {
return paths.map((path) => vscode.Uri.joinPath(extension.extensionUri, path));
}
catch {
return undefined; // Discard the extension.
}
}
/**
* Resolves the Markdown contribution from the VS Code extension.
*
* This function extracts and wraps the contribution without validating the underlying resources.
*/
function resolveMarkdownContribution(extension) {
const contributes = extension.packageJSON && extension.packageJSON.contributes;
if (!contributes) {
return null;
}
const extendMarkdownIt = contributes["markdown.markdownItPlugins"]
? getContributedMarkdownItPlugin(extension)
: undefined;
const previewScripts = contributes["markdown.previewScripts"] && contributes["markdown.previewScripts"].length
? resolveExtensionResourceUris(extension, contributes["markdown.previewScripts"])
: undefined;
const previewStyles = contributes["markdown.previewStyles"] && contributes["markdown.previewStyles"].length
? resolveExtensionResourceUris(extension, contributes["markdown.previewStyles"])
: undefined;
if (!extendMarkdownIt && !previewScripts && !previewStyles) {
return null;
}
return {
extensionId: extension.id,
extensionUri: extension.extensionUri,
extendMarkdownIt,
previewScripts,
previewStyles,
};
}
/**
* Skip these extensions!
*/
const Extension_Blacklist = new Set([
"vscode.markdown-language-features",
"yzhang.markdown-all-in-one", // This.
]);
/**
* The contributions from these extensions can not be utilized directly.
*
* `ID -> Transformer`
*/
const Extension_Special_Treatment = new Map([
["vscode.markdown-math", (original) => ({ ...original, previewStyles: undefined })], // Its CSS is not portable. (#986)
]);
class MarkdownContributionProvider {
constructor() {
this._onDidChangeContributions = new vscode.EventEmitter();
this._disposables = [];
this._cachedContributions = null;
this._isDisposed = false;
this.onDidChangeContributions = this._onDidChangeContributions.event;
this._disposables.push(this._onDidChangeContributions, vscode.extensions.onDidChange(() => {
// `contributions` will rebuild the cache.
this._cachedContributions = null;
this._onDidChangeContributions.fire(this);
}));
}
dispose() {
if (this._isDisposed) {
return;
}
for (const item of this._disposables) {
item.dispose();
}
this._disposables.length = 0;
this._isDisposed = true;
}
get contributions() {
if (!this._cachedContributions) {
this._cachedContributions = vscode.extensions.all.reduce((result, extension) => {
if (Extension_Blacklist.has(extension.id)) {
return result;
}
const c = resolveMarkdownContribution(extension);
if (!c) {
return result;
}
const t = Extension_Special_Treatment.get(extension.id);
result.push(t ? t(c) : c);
return result;
}, []);
}
return this._cachedContributions;
}
}
const defaultProvider = new lazy_1.Lazy(() => new MarkdownContributionProvider());
function getMarkdownContributionProvider() {
return defaultProvider.value;
}
exports.getMarkdownContributionProvider = getMarkdownContributionProvider;
/***/ }),
/***/ "./src/nls/index.ts":
/*!**************************!*\
!*** ./src/nls/index.ts ***!
\**************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.config = exports.localize = void 0;
const fs = __webpack_require__(/*! fs */ "fs");
const vscode = __webpack_require__(/*! vscode */ "vscode");
const resolveResource_1 = __webpack_require__(/*! ./resolveResource */ "./src/nls/resolveResource.ts");
//#region Utility
function readJsonFile(path) {
return JSON.parse(fs.readFileSync(path, "utf8"));
}
//#endregion Utility
//#region Private
// Why `Object.create(null)`:
// Once constructed, this is used as a readonly dictionary (map).
// It is performance-sensitive, and should not be affected by the outside.
// Besides, `Object.prototype` might collide with our keys.
const resolvedBundle = Object.create(null);
/**
* Internal options.
* Will be initialized in `config()`.
*/
const options = Object.create(null);
/**
* Updates the in-memory NLS bundle.
* @param locales An array of locale IDs. The default locale will be appended.
*/
function cacheBundle(locales = []) {
if (options.locale) {
locales.push(options.locale); // Fallback.
}
// * We always provide `package.nls.json`.
// * Reverse the return value, so that we can build a bundle with nice fallback by a simple loop.
const files = (0, resolveResource_1.default)(options.extensionPath, "package.nls", "json", locales).reverse();
for (const path of files) {
try {
Object.assign(resolvedBundle, readJsonFile(path));
}
catch (error) {
console.error(error); // Log, and ignore the bundle.
}
}
}
/**
* @param message A composite format string.
* @param args An array of objects to format.
*/
function format(message, ...args) {
if (args.length === 0) {
return message;
}
else {
return message.replace(/\{(0|[1-9]\d*?)\}/g, (match, index) => {
// `index` is zero-based.
return args.length > +index ? String(args[+index]) : match;
});
}
}
//#endregion Private
//#region Public
const localize = function (key, ...args) {
if (options.cacheResolution) {
const msg = resolvedBundle[key];
return msg === undefined ? "[" + key + "]" : format(msg, ...args);
}
else {
// When in development mode, hot reload, and reveal the key.
cacheBundle();
const msg = resolvedBundle[key];
return msg === undefined ? "[" + key + "]" : "[" + key.substring(key.lastIndexOf(".") + 1) + "] " + format(msg, ...args);
}
};
exports.localize = localize;
/**
* Configures the NLS module.
*
* You should only call it **once** in the application entry point.
*/
function config(opts) {
if (opts.locale) {
options.locale = opts.locale;
}
else {
try {
const vscodeOptions = JSON.parse(process.env.VSCODE_NLS_CONFIG);
options.locale = vscodeOptions.locale;
}
catch (error) {
// Log, but do nothing else, in case VS Code suddenly changes their mind, or we are not in VS Code.
console.error(error);
}
}
options.extensionPath = opts.extensionContext.extensionPath;
options.cacheResolution = opts.extensionContext.extensionMode !== vscode.ExtensionMode.Development;
// Load and freeze the cache when not in development mode.
if (options.cacheResolution) {
cacheBundle();
Object.freeze(resolvedBundle);
}
return exports.localize;
}
exports.config = config;
/***/ }),
/***/ "./src/nls/resolveResource.ts":
/*!************************************!*\
!*** ./src/nls/resolveResource.ts ***!
\************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
const fs = __webpack_require__(/*! fs */ "fs");
const path = __webpack_require__(/*! path */ "path");
/**
* Finds localized resources that match the given pattern under the directory.
*
* ### Remarks
*
* Comparison is case-**sensitive** (SameValueZero).
*
* When an exact match cannot be found, this function performs fallback as per RFC 4647 Lookup.
*
* Make sure the directory does not change.
* Call this function as **few** as possible.
* This function may scan the directory thoroughly, thus is very **expensive**.
*
* ### Exceptions
*
* * The path to the directory is not absolute.
* * The directory does not exist.
* * Read permission is not granted.
*
* @param directory The **absolute** file system path to the directory that Node.js can recognizes, including UNC on Windows.
* @param baseName The string that the file name begins with.
* @param suffix The string that the file name ends with.
* @param locales The locale IDs that can be inserted between `baseName` and `suffix`. Sorted by priority, from high to low.
* @param separator The string to use when joining `baseName`, `locale`, `suffix` together. Defaults to `.` (U+002E).
* @returns An array of absolute paths to matched files, sorted by priority, from high to low. Or `undefined` when no match.
* @example
* // Entries under directory `/tmp`:
* // Directory f.nls.zh-cn.json/
* // File f.nls.json
* // File f.nls.zh.json
*
* resolveResource("/tmp", "f.nls", "json", ["ja", "zh-cn"]);
*
* // Returns:
* ["/tmp/f.nls.zh.json", "/tmp/f.nls.json"];
*/
function resolveResource(directory, baseName, suffix, locales, separator = ".") {
if (!path.isAbsolute(directory)) {
throw new Error("The directory must be an absolute file system path.");
}
// Throw an exception, if we do not have permission, or the directory does not exist.
const files = fs.readdirSync(directory, { withFileTypes: true }).reduce((res, crt) => {
if (crt.isFile()) {
res.push(crt.name);
}
return res;
}, []);
const result = [];
let splitIndex;
for (let loc of locales) {
while (true) {
const fileName = baseName + separator + loc + separator + suffix;
const resolvedPath = path.resolve(directory, fileName);
if (!result.includes(resolvedPath) && files.includes(fileName)) {
result.push(resolvedPath);
}
// Fallback according to RFC 4647 section 3.4. Although they are different systems, algorithms are common.
splitIndex = loc.lastIndexOf("-");
if (splitIndex > 0) {
loc = loc.slice(0, splitIndex);
}
else {
break;
}
}
}
// Fallback. The use of block is to keep the function scope clean.
{
const fileName = baseName + separator + suffix;
const resolvedPath = path.resolve(directory, fileName);
// As long as parameters are legal, this `resolvedPath` won't have been in `result`. Thus, only test `fileName`.
if (files.includes(fileName)) {
result.push(resolvedPath);
}
}
return result.length === 0 ? undefined : result;
}
exports.default = resolveResource;
/***/ }),
/***/ "./src/preview.ts":
/*!************************!*\
!*** ./src/preview.ts ***!
\************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.activate = void 0;
const vscode = __webpack_require__(/*! vscode */ "vscode");
// These are dedicated objects for the auto preview.
let debounceHandle;
let lastDoc;
const d0 = Object.freeze({
_disposables: [],
dispose: function () {
for (const item of this._disposables) {
item.dispose();
}
this._disposables.length = 0;
if (debounceHandle) {
clearTimeout(debounceHandle);
debounceHandle = undefined;
}
lastDoc = undefined;
},
});
function activate(context) {
// Register auto preview. And try showing preview on activation.
const d1 = vscode.workspace.onDidChangeConfiguration((e) => {
if (e.affectsConfiguration("markdown.extension.preview")) {
if (vscode.workspace.getConfiguration("markdown.extension.preview").get("autoShowPreviewToSide")) {
registerAutoPreview();
}
else {
d0.dispose();
}
}
});
if (vscode.workspace.getConfiguration("markdown.extension.preview").get("autoShowPreviewToSide")) {
registerAutoPreview();
triggerAutoPreview(vscode.window.activeTextEditor);
}
// `markdown.extension.closePreview` is just a wrapper for the `workbench.action.closeActiveEditor` command.
// We introduce it to avoid confusing users in UI.
// "Toggle preview" is achieved by contributing key bindings that very carefully match VS Code's default values.
// https://github.com/yzhang-gh/vscode-markdown/pull/780
const d2 = vscode.commands.registerCommand("markdown.extension.closePreview", () => {
return vscode.commands.executeCommand("workbench.action.closeActiveEditor");
});
// Keep code tidy.
context.subscriptions.push(d1, d2, d0);
}
exports.activate = activate;
function registerAutoPreview() {
d0._disposables.push(vscode.window.onDidChangeActiveTextEditor((editor) => triggerAutoPreview(editor)));
}
// VS Code dispatches a series of DidChangeActiveTextEditor events when moving tabs between groups, we don't want most of them.
function triggerAutoPreview(editor) {
if (!editor || editor.document.languageId !== "markdown") {
return;
}
if (debounceHandle) {
clearTimeout(debounceHandle);
debounceHandle = undefined;
}
// Usually, a user only wants to trigger preview when the currently and last viewed documents are not the same.
const doc = editor.document;
if (doc !== lastDoc) {
lastDoc = doc;
debounceHandle = setTimeout(() => autoPreviewToSide(editor), 100);
}
}
/**
* Shows preview for the editor.
*/
async function autoPreviewToSide(editor) {
if (editor.document.isClosed) {
return;
}
// Call `vscode.markdown-language-features`.
await vscode.commands.executeCommand("markdown.showPreviewToSide");
// Wait, as VS Code won't respond when it just opened a preview.
await new Promise((resolve) => setTimeout(resolve, 100));
// VS Code 1.62 appears to make progress in https://github.com/microsoft/vscode/issues/9526
// Thus, we must request the text editor directly with known view column (if available).
await vscode.window.showTextDocument(editor.document, editor.viewColumn);
}
/***/ }),
/***/ "./src/print.ts":
/*!**********************!*\
!*** ./src/print.ts ***!
\**********************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.deactivate = exports.activate = void 0;
const fs = __webpack_require__(/*! fs */ "fs");
const path = __webpack_require__(/*! path */ "path");
const vscode_1 = __webpack_require__(/*! vscode */ "vscode");
const entities_1 = __webpack_require__(/*! entities */ "./node_modules/entities/lib/index.js");
const nls_1 = __webpack_require__(/*! ./nls */ "./src/nls/index.ts");
const markdownEngine_1 = __webpack_require__(/*! ./markdownEngine */ "./src/markdownEngine.ts");
const generic_1 = __webpack_require__(/*! ./util/generic */ "./src/util/generic.ts");
let thisContext;
function activate(context) {
thisContext = context;
context.subscriptions.push(vscode_1.commands.registerCommand('markdown.extension.printToHtml', () => { print('html'); }), vscode_1.commands.registerCommand('markdown.extension.printToHtmlBatch', () => { batchPrint(); }), vscode_1.workspace.onDidSaveTextDocument(onDidSave));
}
exports.activate = activate;
function deactivate() { }
exports.deactivate = deactivate;
function onDidSave(doc) {
if (doc.languageId === 'markdown'
&& vscode_1.workspace.getConfiguration('markdown.extension.print', doc.uri).get('onFileSave')) {
print('html');
}
}
async function print(type, uri, outFolder) {
const editor = vscode_1.window.activeTextEditor;
if (!(0, generic_1.isMdEditor)(editor)) {
vscode_1.window.showErrorMessage((0, nls_1.localize)("ui.general.messageNoValidMarkdownFile"));
return;
}
const doc = uri ? await vscode_1.workspace.openTextDocument(uri) : editor.document;
if (doc.isDirty || doc.isUntitled) {
doc.save();
}
const statusBarMessage = vscode_1.window.setStatusBarMessage("$(sync~spin) " + (0, nls_1.localize)("ui.exporting.messageExportingInProgress", path.basename(doc.fileName), type.toUpperCase()));
if (outFolder && !fs.existsSync(outFolder)) {
fs.mkdirSync(outFolder, { recursive: true });
}
/**
* Modified from
* src/previewContentProvider MDDocumentContentProvider provideTextDocumentContent
*/
let outPath = outFolder ? path.join(outFolder, path.basename(doc.fileName)) : doc.fileName;
outPath = outPath.replace(/\.\w+?$/, `.${type}`);
outPath = outPath.replace(/^([cdefghij]):\\/, function (_, p1) {
return `${p1.toUpperCase()}:\\`; // Capitalize drive letter
});
if (!outPath.endsWith(`.${type}`)) {
outPath += `.${type}`;
}
//// Determine document title.
// 1. If the document begins with a comment like ``, use it. Empty title is not allow here. (GitHub #506)
// 2. Else, find the first ATX heading, and use it.
const firstLineText = doc.lineAt(0).text;
// The lazy quantifier and `trim()` can avoid mistakenly capturing cases like:
// -->
// -->
let m = /^/.exec(firstLineText);
let title = m === null ? undefined : m[1].trim();
// Empty string is also falsy.
if (!title) {
// Editors treat `\r\n`, `\n`, and `\r` as EOL.
// Since we don't care about line numbers, a simple alternation is enough and slightly faster.
title = doc.getText().split(/\n|\r/g).find(lineText => lineText.startsWith('#') && /^#{1,6} /.test(lineText));
if (title) {
title = title.trim().replace(/^#+/, '').replace(/#+$/, '').trim();
}
}
//// Render body HTML.
let body = await markdownEngine_1.mdEngine.render(doc.getText(), vscode_1.workspace.getConfiguration('markdown.preview', doc.uri));
//// Image paths
const config = vscode_1.workspace.getConfiguration('markdown.extension', doc.uri);
const configToBase64 = config.get('print.imgToBase64');
const configAbsPath = config.get('print.absoluteImgPath');
const imgTagRegex = /(
]+src=")([^"]+)("[^>]*>)/g; // Match ''
if (configToBase64) {
body = body.replace(imgTagRegex, function (_, p1, p2, p3) {
if (p2.startsWith('http') || p2.startsWith('data:')) {
return _;
}
const imgSrc = relToAbsPath(doc.uri, p2);
try {
let imgExt = path.extname(imgSrc).slice(1);
if (imgExt === "jpg") {
imgExt = "jpeg";
}
else if (imgExt === "svg") {
imgExt += "+xml";
}
const file = fs.readFileSync(imgSrc.replace(/%20/g, '\ ')).toString('base64');
return `${p1}data:image/${imgExt};base64,${file}${p3}`;
}
catch (e) {
vscode_1.window.showWarningMessage((0, nls_1.localize)("ui.general.messageUnableToReadFile", imgSrc) + ` ${(0, nls_1.localize)("ui.exporting.messageRevertingToImagePaths")} (${doc.fileName})`);
}
if (configAbsPath) {
return `${p1}file:///${imgSrc}${p3}`;
}
else {
return _;
}
});
}
else if (configAbsPath) {
body = body.replace(imgTagRegex, function (_, p1, p2, p3) {
if (p2.startsWith('http') || p2.startsWith('data:')) {
return _;
}
const imgSrc = relToAbsPath(doc.uri, p2);
// Absolute paths need `file:///` but relative paths don't
return `${p1}file:///${imgSrc}${p3}`;
});
}
//// Convert `.md` links to `.html` by default (#667)
const hrefRegex = /(]+href=")([^"]+)("[^>]*>)/g; // Match ''
body = body.replace(hrefRegex, function (_, g1, g2, g3) {
if (g2.endsWith('.md')) {
return `${g1}${g2.replace(/\.md$/, '.html')}${g3}`;
}
else {
return _;
}
});
const hasMath = hasMathEnv(doc.getText());
const extensionStyles = await getPreviewExtensionStyles();
const extensionScripts = await getPreviewExtensionScripts();
const includeVscodeStyles = config.get('print.includeVscodeStylesheets');
const themeKind = config.get('print.theme');
const themeClass = themeKind === 'light' ? 'vscode-light' : themeKind === 'dark' ? 'vscode-dark' : '';
const html = `
${title ? (0, entities_1.encodeHTML)(title) : ''}
${extensionStyles}
${getStyles(doc.uri, hasMath, includeVscodeStyles)}
${body}
${hasMath ? '' : ''}
${extensionScripts}
`;
switch (type) {
case 'html':
fs.writeFile(outPath, html, 'utf-8', function (err) {
if (err) {
console.log(err);
}
});
break;
case 'pdf':
break;
}
// Hold the message for extra 500ms, in case the operation finished very fast.
setTimeout(() => statusBarMessage.dispose(), 500);
}
function batchPrint() {
const doc = vscode_1.window.activeTextEditor.document;
const root = vscode_1.workspace.getWorkspaceFolder(doc.uri).uri;
vscode_1.window.showOpenDialog({ defaultUri: root, openLabel: 'Select source folder', canSelectFiles: false, canSelectFolders: true }).then(uris => {
if (uris && uris.length > 0) {
const selectedPath = uris[0].fsPath;
const relPath = path.relative(root.fsPath, selectedPath);
if (relPath.startsWith('..')) {
vscode_1.window.showErrorMessage('Cannot use a path outside the current folder');
return;
}
vscode_1.workspace.findFiles((relPath.length > 0 ? relPath + '/' : '') + '**/*.{md}', '{**/node_modules,**/bower_components,**/*.code-search}').then(uris => {
vscode_1.window.showInputBox({
value: selectedPath + path.sep + 'out',
valueSelection: [selectedPath.length + 1, selectedPath.length + 4],
prompt: 'Please specify an output folder'
}).then(outFolder => {
uris.forEach(uri => {
print('html', uri, path.join(outFolder, path.relative(selectedPath, path.dirname(uri.fsPath))));
});
});
});
}
});
}
function hasMathEnv(text) {
// I'm lazy
return text.includes('$');
}
function getMediaPath(mediaFile) {
return thisContext.asAbsolutePath(path.join('media', mediaFile));
}
function wrapWithStyleTag(src) {
if (src.startsWith('http')) {
return ``;
}
else {
return ``;
}
}
function readCss(fileName) {
try {
return fs.readFileSync(fileName).toString();
}
catch (error) {
// https://nodejs.org/docs/latest-v12.x/api/errors.html#errors_class_systemerror
vscode_1.window.showWarningMessage((0, nls_1.localize)("ui.exporting.messageCustomCssNotFound", error.path));
return '';
}
}
function getStyles(uri, hasMathEnv, includeVscodeStyles) {
const katexCss = '';
const markdownCss = '';
const highlightCss = '';
const copyTeXCss = '';
const baseCssPaths = ['checkbox.css'].map(s => getMediaPath(s));
const customCssPaths = getCustomStyleSheets(uri);
return `${hasMathEnv ? katexCss + '\n' + copyTeXCss : ''}
${includeVscodeStyles
? markdownCss + '\n' + highlightCss + '\n' + getPreviewSettingStyles()
: ''}
${baseCssPaths.map(cssSrc => wrapWithStyleTag(cssSrc)).join('\n')}
${customCssPaths.map(cssSrc => wrapWithStyleTag(cssSrc)).join('\n')}`;
}
function getCustomStyleSheets(resource) {
const styles = vscode_1.workspace.getConfiguration('markdown', resource)['styles'];
if (styles && Array.isArray(styles) && styles.length > 0) {
const root = vscode_1.workspace.getWorkspaceFolder(resource);
return styles.map(s => {
if (!s || s.startsWith('http') || path.isAbsolute(s)) {
return s;
}
if (root) {
return path.join(root.uri.fsPath, s);
}
else {
// Otherwise look relative to the markdown file
return path.join(path.dirname(resource.fsPath), s);
}
});
}
return [];
}
function relToAbsPath(resource, href) {
if (!href || href.startsWith('http') || path.isAbsolute(href)) {
return href;
}
// Otherwise look relative to the markdown file
return path.join(path.dirname(resource.fsPath), href);
}
function getPreviewSettingStyles() {
const previewSettings = vscode_1.workspace.getConfiguration('markdown')['preview'];
if (!previewSettings) {
return '';
}
const { fontFamily, fontSize, lineHeight } = previewSettings;
return ``;
}
async function getPreviewExtensionStyles() {
var result = "";
return result;
}
async function getPreviewExtensionScripts() {
var result = "";
for (const contribute of markdownEngine_1.mdEngine.contributionsProvider.contributions) {
if (!contribute.previewScripts || !contribute.previewScripts.length) {
continue;
}
for (const scriptFile of contribute.previewScripts) {
result += `\n`;
}
}
return result;
}
/***/ }),
/***/ "./src/syntaxDecorations.ts":
/*!**********************************!*\
!*** ./src/syntaxDecorations.ts ***!
\**********************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
// This module is deprecated.
// No update will land here.
// It is superseded by `src/theming`, etc.
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.activate = void 0;
const vscode = __webpack_require__(/*! vscode */ "vscode");
const contextCheck_1 = __webpack_require__(/*! ./util/contextCheck */ "./src/util/contextCheck.ts");
const decorationStyles = {
[0 /* baseColor */]: {
"dark": { "color": "#EEFFFF" },
"light": { "color": "000000" },
},
[1 /* gray */]: {
"rangeBehavior": 1,
"dark": { "color": "#636363" },
"light": { "color": "#CCC" },
},
[2 /* lightBlue */]: {
"color": "#4080D0",
},
[3 /* orange */]: {
"color": "#D2B640",
},
};
const regexDecorTypeMappingPlainTheme = [
// [alt](link)
[
/(^|[^!])(\[)([^\]\r\n]*?(?!\].*?\[)[^\[\r\n]*?)(\]\(.+?\))/,
[undefined, 1 /* gray */, 2 /* lightBlue */, 1 /* gray */]
],
// 
[
/(\!\[)([^\]\r\n]*?(?!\].*?\[)[^\[\r\n]*?)(\]\(.+?\))/,
[1 /* gray */, 3 /* orange */, 1 /* gray */]
],
// `code`
[
/(?\/\?\s].*?[^\*\`\!\@\#\%\^\&\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s])(\*)/,
[1 /* gray */, 0 /* baseColor */, 1 /* gray */]
],
// _italic_
[
/(_)([^\*\`\!\@\#\%\^\&\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s].*?[^\*\`\!\@\#\%\^\&\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s])(_)/,
[1 /* gray */, 0 /* baseColor */, 1 /* gray */]
],
// **bold**
[
/(\*\*)([^\*\`\!\@\#\%\^\&\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s].*?[^\*\`\!\@\#\%\^\&\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s])(\*\*)/,
[1 /* gray */, 0 /* baseColor */, 1 /* gray */]
],
];
//#endregion Constant
/**
* Decoration type instances **currently in use**.
*/
const decorationHandles = new Map();
const decors = new Map();
function activate(context) {
context.subscriptions.push(vscode.workspace.onDidChangeConfiguration(event => {
if (event.affectsConfiguration("markdown.extension.syntax.plainTheme")) {
triggerUpdateDecorations(vscode.window.activeTextEditor);
}
}), vscode.window.onDidChangeActiveTextEditor(triggerUpdateDecorations), vscode.workspace.onDidChangeTextDocument(event => {
const editor = vscode.window.activeTextEditor;
if (editor && event.document === editor.document) {
triggerUpdateDecorations(editor);
}
}));
triggerUpdateDecorations(vscode.window.activeTextEditor);
}
exports.activate = activate;
var timeout;
// Debounce.
function triggerUpdateDecorations(editor) {
if (!editor || editor.document.languageId !== "markdown") {
return;
}
if (timeout) {
clearTimeout(timeout);
}
timeout = setTimeout(() => updateDecorations(editor), 200);
}
/**
* Clears decorations in the text editor.
*/
function clearDecorations(editor) {
for (const handle of decorationHandles.values()) {
editor.setDecorations(handle, []);
}
}
function updateDecorations(editor) {
// Remove everything if it's disabled.
if (!vscode.workspace.getConfiguration().get("markdown.extension.syntax.plainTheme", false)) {
for (const handle of decorationHandles.values()) {
handle.dispose();
}
decorationHandles.clear();
return;
}
const doc = editor.document;
if (doc.getText().length * 1.5 > vscode.workspace.getConfiguration().get("markdown.extension.syntax.decorationFileSizeLimit")) {
clearDecorations(editor); // In case the editor is still visible.
return;
}
// Reset decoration collection.
decors.clear();
for (const typeName of Object.keys(decorationStyles)) {
decors.set(+typeName, []);
}
// Analyze.
doc.getText().split(/\r?\n/g).forEach((lineText, lineNum) => {
if ((0, contextCheck_1.isInFencedCodeBlock)(doc, lineNum)) {
return;
}
// Issue #412
// Trick. Match `[alt](link)` and `` first and remember those greyed out ranges
const noDecorRanges = [];
for (const [re, types] of regexDecorTypeMappingPlainTheme) {
const regex = new RegExp(re, "g");
for (const match of lineText.matchAll(regex)) {
let startIndex = match.index;
if (noDecorRanges.some(r => (startIndex > r[0] && startIndex < r[1])
|| (startIndex + match[0].length > r[0] && startIndex + match[0].length < r[1]))) {
continue;
}
for (let i = 0; i < types.length; i++) {
//// Skip if in math environment (See `completion.ts`)
if ((0, contextCheck_1.mathEnvCheck)(doc, new vscode.Position(lineNum, startIndex)) !== "") {
break;
}
const typeName = types[i];
const caughtGroup = match[i + 1];
if (typeName === 1 /* gray */ && caughtGroup.length > 2) {
noDecorRanges.push([startIndex, startIndex + caughtGroup.length]);
}
const range = new vscode.Range(lineNum, startIndex, lineNum, startIndex + caughtGroup.length);
startIndex += caughtGroup.length;
//// Needed for `[alt](link)` rule. And must appear after `startIndex += caughtGroup.length;`
if (!typeName) {
continue;
}
// We've created these arrays at the beginning of the function.
decors.get(typeName).push(range);
}
}
}
});
// Apply decorations.
for (const [typeName, ranges] of decors) {
let handle = decorationHandles.get(typeName);
// Create a new decoration type instance if needed.
if (!handle) {
handle = vscode.window.createTextEditorDecorationType(decorationStyles[typeName]);
decorationHandles.set(typeName, handle);
}
editor.setDecorations(handle, ranges);
}
}
/***/ }),
/***/ "./src/tableFormatter.ts":
/*!*******************************!*\
!*** ./src/tableFormatter.ts ***!
\*******************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.deactivate = exports.activate = void 0;
// https://github.github.com/gfm/#tables-extension-
const vscode_1 = __webpack_require__(/*! vscode */ "vscode");
const generic_1 = __webpack_require__(/*! ./util/generic */ "./src/util/generic.ts");
//// This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export.
// import { GraphemeSplitter } from 'grapheme-splitter';
const GraphemeSplitter = __webpack_require__(/*! grapheme-splitter */ "./node_modules/grapheme-splitter/index.js");
const splitter = new GraphemeSplitter();
function activate(_) {
let registration;
function registerFormatterIfEnabled() {
const isEnabled = vscode_1.workspace.getConfiguration().get('markdown.extension.tableFormatter.enabled', true);
if (isEnabled && !registration) {
registration = vscode_1.languages.registerDocumentFormattingEditProvider(generic_1.Document_Selector_Markdown, new MarkdownDocumentFormatter());
}
else if (!isEnabled && registration) {
registration.dispose();
registration = undefined;
}
}
registerFormatterIfEnabled();
vscode_1.workspace.onDidChangeConfiguration(event => {
if (event.affectsConfiguration('markdown.extension.tableFormatter.enabled')) {
registerFormatterIfEnabled();
}
});
}
exports.activate = activate;
function deactivate() { }
exports.deactivate = deactivate;
var ColumnAlignment;
(function (ColumnAlignment) {
ColumnAlignment[ColumnAlignment["None"] = 0] = "None";
ColumnAlignment[ColumnAlignment["Left"] = 1] = "Left";
ColumnAlignment[ColumnAlignment["Center"] = 2] = "Center";
ColumnAlignment[ColumnAlignment["Right"] = 3] = "Right";
})(ColumnAlignment || (ColumnAlignment = {}));
class MarkdownDocumentFormatter {
provideDocumentFormattingEdits(document, options, token) {
let edits = [];
let tables = this.detectTables(document.getText());
if (tables !== null) {
let startingPos = 0;
tables.forEach(table => {
const tableRange = this.getRange(document, table, startingPos);
edits.push(new vscode_1.TextEdit(tableRange, this.formatTable(table, document, options)));
startingPos = document.offsetAt(tableRange.end);
});
return edits;
}
else {
return [];
}
}
detectTables(text) {
const lineBreak = String.raw `\r?\n`;
const contentLine = String.raw `\|?.*\|.*\|?`;
const leftSideHyphenComponent = String.raw `(?:\|? *:?-+:? *\|)`;
const middleHyphenComponent = String.raw `(?: *:?-+:? *\|)*`;
const rightSideHyphenComponent = String.raw `(?: *:?-+:? *\|?)`;
const multiColumnHyphenLine = leftSideHyphenComponent + middleHyphenComponent + rightSideHyphenComponent;
//// GitHub issue #431
const singleColumnHyphenLine = String.raw `(?:\| *:?-+:? *\|)`;
const hyphenLine = String.raw `[ \t]*(?:${multiColumnHyphenLine}|${singleColumnHyphenLine})[ \t]*`;
const tableRegex = new RegExp(contentLine + lineBreak + hyphenLine + '(?:' + lineBreak + contentLine + ')*', 'g');
return text.match(tableRegex);
}
getRange(document, text, startingPos) {
let documentText = document.getText();
let start = document.positionAt(documentText.indexOf(text, startingPos));
let end = document.positionAt(documentText.indexOf(text, startingPos) + text.length);
return new vscode_1.Range(start, end);
}
/**
* Return the indentation of a table as a string of spaces by reading it from the first line.
* In case of `markdown.extension.table.normalizeIndentation` is `enabled` it is rounded to the closest multiple of
* the configured `tabSize`.
*/
getTableIndentation(text, options) {
let doNormalize = vscode_1.workspace.getConfiguration('markdown.extension.tableFormatter').get('normalizeIndentation');
let indentRegex = new RegExp(/^(\s*)\S/u);
let match = text.match(indentRegex);
let spacesInFirstLine = match[1].length;
let tabStops = Math.round(spacesInFirstLine / options.tabSize);
let spaces = doNormalize ? " ".repeat(options.tabSize * tabStops) : " ".repeat(spacesInFirstLine);
return spaces;
}
formatTable(text, doc, options) {
const delimiterRowIndex = 1;
const delimiterRowNoPadding = vscode_1.workspace.getConfiguration('markdown.extension.tableFormatter').get('delimiterRowNoPadding');
const indentation = this.getTableIndentation(text, options);
const rows = [];
const rowsNoIndentPattern = new RegExp(/^\s*(\S.*)$/gum);
let match = null;
while ((match = rowsNoIndentPattern.exec(text)) !== null) {
rows.push(match[1].trim());
}
// Column "content" width (the length of the longest cell in each column), **without padding**
const colWidth = [];
// Alignment of each column
const colAlign = [];
// Regex to extract cell content.
// GitHub #24
const fieldRegExp = new RegExp(/((\\\||[^\|])*)\|/gu);
// https://www.ling.upenn.edu/courses/Spring_2003/ling538/UnicodeRanges.html
const cjkRegex = /[\u3000-\u9fff\uac00-\ud7af\uff01-\uff60]/g;
const lines = rows.map((row, iRow) => {
// Normalize
if (row.startsWith('|')) {
row = row.slice(1);
}
if (!row.endsWith('|')) {
row = row + '|';
}
// Parse cells in the current row
let field = null;
let values = [];
let iCol = 0;
while ((field = fieldRegExp.exec(row)) !== null) {
let cell = field[1].trim();
values.push(cell);
// Ignore the length of delimiter-line before we normalize it
if (iRow != delimiterRowIndex) {
// Treat CJK characters as 2 English ones because of Unicode stuff
const numOfUnicodeChars = splitter.countGraphemes(cell);
const width = cjkRegex.test(cell) ? numOfUnicodeChars + cell.match(cjkRegex).length : numOfUnicodeChars;
colWidth[iCol] = colWidth[iCol] > width ? colWidth[iCol] : width;
}
iCol++;
}
return values;
});
// Normalize the num of hyphen
lines[delimiterRowIndex] = lines[delimiterRowIndex].map((cell, iCol) => {
if (/:-+:/.test(cell)) {
// :---:
colAlign[iCol] = ColumnAlignment.Center;
// Update `colWidth` (lower bound) based on the column alignment specification
colWidth[iCol] = Math.max(colWidth[iCol], delimiterRowNoPadding ? 5 - 2 : 5);
const specWidth = delimiterRowNoPadding ? colWidth[iCol] + 2 : colWidth[iCol];
return ':' + '-'.repeat(specWidth - 2) + ':';
}
else if (/:-+/.test(cell)) {
// :---
colAlign[iCol] = ColumnAlignment.Left;
colWidth[iCol] = Math.max(colWidth[iCol], delimiterRowNoPadding ? 4 - 2 : 4);
const specWidth = delimiterRowNoPadding ? colWidth[iCol] + 2 : colWidth[iCol];
return ':' + '-'.repeat(specWidth - 1);
}
else if (/-+:/.test(cell)) {
// ---:
colAlign[iCol] = ColumnAlignment.Right;
colWidth[iCol] = Math.max(colWidth[iCol], delimiterRowNoPadding ? 4 - 2 : 4);
const specWidth = delimiterRowNoPadding ? colWidth[iCol] + 2 : colWidth[iCol];
return '-'.repeat(specWidth - 1) + ':';
}
else if (/-+/.test(cell)) {
// ---
colAlign[iCol] = ColumnAlignment.None;
colWidth[iCol] = Math.max(colWidth[iCol], delimiterRowNoPadding ? 3 - 2 : 3);
const specWidth = delimiterRowNoPadding ? colWidth[iCol] + 2 : colWidth[iCol];
return '-'.repeat(specWidth);
}
else {
colAlign[iCol] = ColumnAlignment.None;
}
});
return lines.map((row, iRow) => {
if (iRow === delimiterRowIndex && delimiterRowNoPadding) {
return indentation + '|' + row.join('|') + '|';
}
let cells = row.map((cell, iCol) => {
const desiredWidth = colWidth[iCol];
let jsLength = splitter.splitGraphemes(cell + ' '.repeat(desiredWidth)).slice(0, desiredWidth).join('').length;
if (cjkRegex.test(cell)) {
jsLength -= cell.match(cjkRegex).length;
}
return this.alignText(cell, colAlign[iCol], jsLength);
});
return indentation + '| ' + cells.join(' | ') + ' |';
}).join(doc.eol === vscode_1.EndOfLine.LF ? '\n' : '\r\n');
}
alignText(text, align, length) {
if (align === ColumnAlignment.Center && length > text.length) {
return (' '.repeat(Math.floor((length - text.length) / 2)) + text + ' '.repeat(length)).slice(0, length);
}
else if (align === ColumnAlignment.Right) {
return (' '.repeat(length) + text).slice(-length);
}
else {
return (text + ' '.repeat(length)).slice(0, length);
}
}
}
/***/ }),
/***/ "./src/theming/constant.ts":
/*!*********************************!*\
!*** ./src/theming/constant.ts ***!
\*********************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.decorationClassConfigMap = exports.decorationStyles = void 0;
const vscode = __webpack_require__(/*! vscode */ "vscode");
const colors = {
[0 /* EditorCodeSpanBackground */]: new vscode.ThemeColor("markdown.extension.editor.codeSpan.background"),
[1 /* EditorCodeSpanBorder */]: new vscode.ThemeColor("markdown.extension.editor.codeSpan.border"),
[2 /* EditorFormattingMarkForeground */]: new vscode.ThemeColor("markdown.extension.editor.formattingMark.foreground"),
[3 /* EditorTrailingSpaceBackground */]: new vscode.ThemeColor("markdown.extension.editor.trailingSpace.background"),
};
const fontIcons = {
[0 /* DownwardsArrow */]: {
contentText: "↓",
color: colors[2 /* EditorFormattingMarkForeground */],
},
[1 /* DownwardsArrowWithCornerLeftwards */]: {
contentText: "↵",
color: colors[2 /* EditorFormattingMarkForeground */],
},
[2 /* Link */]: {
contentText: "\u{1F517}\u{FE0E}",
color: colors[2 /* EditorFormattingMarkForeground */],
},
[3 /* Pilcrow */]: {
contentText: "¶",
color: colors[2 /* EditorFormattingMarkForeground */],
},
};
/**
* Rendering styles for each decoration class.
*/
exports.decorationStyles = {
[0 /* CodeSpan */]: {
backgroundColor: colors[0 /* EditorCodeSpanBackground */],
border: "1px solid",
borderColor: colors[1 /* EditorCodeSpanBorder */],
borderRadius: "3px",
rangeBehavior: vscode.DecorationRangeBehavior.ClosedClosed,
},
[1 /* HardLineBreak */]: {
after: fontIcons[1 /* DownwardsArrowWithCornerLeftwards */],
rangeBehavior: vscode.DecorationRangeBehavior.ClosedClosed,
},
[2 /* Link */]: {
before: fontIcons[2 /* Link */],
rangeBehavior: vscode.DecorationRangeBehavior.ClosedClosed,
},
[3 /* Paragraph */]: {
after: fontIcons[3 /* Pilcrow */],
rangeBehavior: vscode.DecorationRangeBehavior.ClosedClosed,
},
[4 /* Strikethrough */]: {
rangeBehavior: vscode.DecorationRangeBehavior.ClosedClosed,
textDecoration: "line-through",
},
[5 /* TrailingSpace */]: {
backgroundColor: colors[3 /* EditorTrailingSpaceBackground */],
},
};
/**
* DecorationClass -> Configuration key
*/
exports.decorationClassConfigMap = {
[0 /* CodeSpan */]: "theming.decoration.renderCodeSpan",
[1 /* HardLineBreak */]: "theming.decoration.renderHardLineBreak",
[2 /* Link */]: "theming.decoration.renderLink",
[3 /* Paragraph */]: "theming.decoration.renderParagraph",
[4 /* Strikethrough */]: "theming.decoration.renderStrikethrough",
[5 /* TrailingSpace */]: "theming.decoration.renderTrailingSpace",
};
/***/ }),
/***/ "./src/theming/decorationManager.ts":
/*!******************************************!*\
!*** ./src/theming/decorationManager.ts ***!
\******************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.decorationManager = void 0;
const vscode = __webpack_require__(/*! vscode */ "vscode");
const manager_1 = __webpack_require__(/*! ../configuration/manager */ "./src/configuration/manager.ts");
const constant_1 = __webpack_require__(/*! ./constant */ "./src/theming/constant.ts");
const decorationWorkerRegistry_1 = __webpack_require__(/*! ./decorationWorkerRegistry */ "./src/theming/decorationWorkerRegistry.ts");
class DecorationAnalysisTask {
constructor(document, workers, targets) {
this._result = undefined;
this.document = document;
const token = (this._cts = new vscode.CancellationTokenSource()).token;
// The weird nesting is to defer the task creation to reduce runtime cost.
// The outermost is a so-called "cancellable promise".
// If you create a task and cancel it immediately, this design guarantees that most workers are not called.
// Otherwise, you will observe thousands of discarded microtasks quickly.
this.executor = new Promise((resolve, reject) => {
token.onCancellationRequested(reject);
if (token.isCancellationRequested) {
reject();
}
resolve(Promise.all(targets.map(target => workers[target](document, token))));
})
.then(result => this._result = result) // Copy the result and pass it down.
.catch(reason => {
// We'll adopt `vscode.CancellationError` when it matures.
// For now, falsy indicates cancellation, and we won't throw an exception for that.
if (reason) {
throw reason;
}
});
}
get result() {
return this._result;
}
get state() {
if (this._cts.token.isCancellationRequested) {
return 2 /* Cancelled */;
}
else if (this._result) {
return 1 /* Fulfilled */;
}
else {
return 0 /* Pending */;
}
}
cancel() {
this._cts.cancel();
this._cts.dispose();
}
}
/**
* Represents a text editor decoration manager.
*
* For reliability reasons, do not leak any mutable content out of the manager.
*
* VS Code does not define a corresponding `*Provider` interface, so we implement it ourselves.
* The following scenarios are considered:
*
* * Activation.
* * Opening a document with/without corresponding editors.
* * Changing a document.
* * Closing a document.
* * Closing a Markdown editor, and immediately switching to an arbitrary editor.
* * Switching between arbitrary editors, including Markdown to Markdown.
* * Changing configuration after a decoration analysis task started.
* * Deactivation.
*/
class DecorationManager {
constructor(workers) {
/**
* Decoration type instances **currently in use**.
*/
this._decorationHandles = new Map();
/**
* Decoration analysis tasks **currently in use**.
* This serves as both a task pool, and a result cache.
*/
this._tasks = new Map();
this._decorationWorkers = Object.assign(Object.create(null), workers);
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Property_Accessors#property_names
this._supportedClasses = Object.keys(workers).map(Number);
// Here are many different kinds of calls. Bind `this` context carefully.
// Load all.
vscode.workspace.textDocuments.forEach(this.updateCache, this);
const activeEditor = vscode.window.activeTextEditor;
if (activeEditor) {
this.applyDecoration(activeEditor);
}
// Register event listeners.
this._disposables = [
vscode.workspace.onDidOpenTextDocument(this.updateCache, this),
vscode.workspace.onDidChangeTextDocument(event => {
this.updateCache(event.document);
const activeEditor = vscode.window.activeTextEditor;
if (activeEditor && activeEditor.document === event.document) {
this.applyDecoration(activeEditor);
}
}),
vscode.workspace.onDidCloseTextDocument(this.collectGarbage, this),
vscode.window.onDidChangeActiveTextEditor(editor => { if (editor) {
this.applyDecoration(editor);
} }),
];
}
dispose() {
// Unsubscribe event listeners.
for (const disposable of this._disposables) {
disposable.dispose();
}
this._disposables.length = 0;
// Stop rendering.
if (this._displayDebounceHandle) {
this._displayDebounceHandle.cancel();
this._displayDebounceHandle.dispose();
}
this._displayDebounceHandle = undefined;
// Terminate tasks.
for (const task of this._tasks.values()) {
task.cancel();
}
this._tasks.clear();
// Remove decorations.
for (const handle of this._decorationHandles.values()) {
handle.dispose();
}
this._decorationHandles.clear();
}
/**
* Applies a set of decorations to the text editor asynchronously.
*
* This method is expected to be started frequently on volatile state.
* It begins with a short sync part, to make immediate response to event possible.
* Then, it internally creates an async job, to keep data access correct.
* It stops silently, if any condition is not met.
*
* For performance reasons, it only works on the **active** editor (not visible editors),
* although VS Code renders decorations as long as the editor is visible.
* Besides, we have a threshold to stop analyzing large documents.
* When it is reached, related task will be unavailable, thus by design, this method will quit.
*/
applyDecoration(editor) {
const document = editor.document;
if (document.languageId !== "markdown" /* Markdown */) {
return;
}
// The task can be in any state (typically pending, fulfilled, obsolete) during this call.
// The editor can be suspended or even disposed at any time.
// Thus, we have to check at each stage.
const task = this._tasks.get(document);
if (!task || task.state === 2 /* Cancelled */) {
return;
}
// Discard the previous operation, in case the user is switching between editors fast.
// Although I don't think a debounce can make much value.
if (this._displayDebounceHandle) {
this._displayDebounceHandle.cancel();
this._displayDebounceHandle.dispose();
}
const debounceToken = (this._displayDebounceHandle = new vscode.CancellationTokenSource()).token;
// Queue the display refresh job.
(async () => {
if (task.state === 0 /* Pending */) {
await task.executor;
}
if (task.state !== 1 /* Fulfilled */ || debounceToken.isCancellationRequested) {
return;
}
const results = task.result;
for (const { ranges, target } of results) {
let handle = this._decorationHandles.get(target);
// Recheck applicability, since the user may happen to change settings.
if (manager_1.configManager.get(constant_1.decorationClassConfigMap[target])) {
// Create a new decoration type instance if needed.
if (!handle) {
handle = vscode.window.createTextEditorDecorationType(constant_1.decorationStyles[target]);
this._decorationHandles.set(target, handle);
}
}
else {
// Remove decorations if the type is disabled.
if (handle) {
handle.dispose();
this._decorationHandles.delete(target);
}
continue;
}
if (debounceToken.isCancellationRequested
|| task.state !== 1 /* Fulfilled */ // Confirm the cache is still up-to-date.
|| vscode.window.activeTextEditor !== editor // Confirm the editor is still active.
) {
return;
}
// Create a shallow copy for VS Code to use. This operation shouldn't cost much.
editor.setDecorations(handle, Array.from(ranges));
}
})();
}
/**
* Terminates tasks that are linked to the document, and frees corresponding resources.
*/
collectGarbage(document) {
const task = this._tasks.get(document);
if (task) {
task.cancel();
this._tasks.delete(document);
}
}
/**
* Initiates and **queues** a decoration cache update task that is linked to the document.
*/
updateCache(document) {
if (document.languageId !== "markdown" /* Markdown */) {
return;
}
// Discard previous tasks. Effectively mark existing cache as obsolete.
this.collectGarbage(document);
// Stop if the document exceeds max length.
// The factor is for compatibility. There should be new logic someday.
if (document.getText().length * 1.5 > manager_1.configManager.get("syntax.decorationFileSizeLimit")) {
return;
}
// Create the new task.
this._tasks.set(document, new DecorationAnalysisTask(document, this._decorationWorkers,
// No worry. `applyDecoration()` should recheck applicability.
this._supportedClasses.filter(target => manager_1.configManager.get(constant_1.decorationClassConfigMap[target]))));
}
}
exports.decorationManager = new DecorationManager(decorationWorkerRegistry_1.default);
/***/ }),
/***/ "./src/theming/decorationWorkerRegistry.ts":
/*!*************************************************!*\
!*** ./src/theming/decorationWorkerRegistry.ts ***!
\*************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
const vscode = __webpack_require__(/*! vscode */ "vscode");
const markdownEngine_1 = __webpack_require__(/*! ../markdownEngine */ "./src/markdownEngine.ts");
// ## Organization
//
// Sort in alphabetical order.
// Place a blank line between two entries.
// Place a trailing comma at the end of each entry.
//
// ## Template
//
// It's recommended to use this so-called "cancellable promise".
// If you have to write async function for some reason,
// remember to add cancellation checks based on your experience.
//
// ````typescript
// [DecorationClass.TrailingSpace]: (document, token) => {
// return new Promise((resolve, reject): void => {
// token.onCancellationRequested(reject);
// if (token.isCancellationRequested) {
// reject();
// }
//
// const ranges: vscode.Range[] = [];
//
// resolve({ target: DecorationClass.TrailingSpace, ranges });
// });
// },
// ````
/**
* The registry of decoration analysis workers.
*/
const decorationWorkerRegistry = {
[0 /* CodeSpan */]: async (document, token) => {
if (token.isCancellationRequested) {
throw undefined;
}
const text = document.getText();
// Tokens in, for example, table doesn't have `map`.
// Tables themselves are strange enough. So, skipping them is acceptable.
const tokens = (await markdownEngine_1.mdEngine.getDocumentToken(document)).tokens
.filter(t => t.type === "inline" && t.map);
if (token.isCancellationRequested) {
throw undefined;
}
const ranges = [];
for (const { content, children, map } of tokens) {
const initOffset = text.indexOf(content, document.offsetAt(new vscode.Position(map[0], 0)));
let beginOffset = initOffset;
let endOffset = initOffset;
for (const t of children) {
if (t.type !== "code_inline") {
beginOffset += t.content.length; // Not accurate, but enough.
continue;
}
// The `content` is "normalized", not raw.
// Thus, in some cases, we need to perform a fuzzy search, and the result cannot be precise.
let codeSpanText = t.markup + t.content + t.markup;
let cursor = text.indexOf(codeSpanText, beginOffset);
if (cursor === -1) { // There may be one space on both sides.
codeSpanText = t.markup + " " + t.content + " " + t.markup;
cursor = text.indexOf(codeSpanText, beginOffset);
}
if (cursor !== -1) { // Good.
beginOffset = cursor;
endOffset = beginOffset + codeSpanText.length;
}
else {
beginOffset = text.indexOf(t.markup, beginOffset);
// See if the first piece of `content` can help us.
const searchPos = beginOffset + t.markup.length;
const searchText = t.content.slice(0, t.content.indexOf(" "));
cursor = text.indexOf(searchText, searchPos);
endOffset = cursor !== -1
? text.indexOf(t.markup, cursor + searchText.length) + t.markup.length
: text.indexOf(t.markup, searchPos) + t.markup.length;
}
ranges.push(new vscode.Range(document.positionAt(beginOffset), document.positionAt(endOffset)));
beginOffset = endOffset;
}
if (token.isCancellationRequested) {
throw undefined;
}
}
return { target: 0 /* CodeSpan */, ranges };
},
[1 /* HardLineBreak */]: (document, token) => {
return new Promise((resolve, reject) => {
token.onCancellationRequested(reject);
if (token.isCancellationRequested) {
reject();
}
// Use commonMarkEngine for reliability, at the expense of accuracy.
const tokens = markdownEngine_1.commonMarkEngine.getDocumentToken(document).tokens.filter(t => t.type === "inline");
const ranges = [];
for (const { children, map } of tokens) {
let lineIndex = map[0];
for (const t of children) {
switch (t.type) {
case "softbreak":
lineIndex++;
break;
case "hardbreak":
const pos = document.lineAt(lineIndex).range.end;
ranges.push(new vscode.Range(pos, pos));
lineIndex++;
break;
}
}
}
resolve({ target: 1 /* HardLineBreak */, ranges });
});
},
[2 /* Link */]: (document, token) => {
return new Promise((resolve, reject) => {
token.onCancellationRequested(reject);
if (token.isCancellationRequested) {
reject();
}
// A few kinds of inline links.
const ranges = Array.from(document.getText().matchAll(/(? {
const pos = document.positionAt(m.index);
return new vscode.Range(pos, pos);
});
resolve({ target: 2 /* Link */, ranges });
});
},
[3 /* Paragraph */]: async (document, token) => {
if (token.isCancellationRequested) {
throw undefined;
}
const { tokens } = (await markdownEngine_1.mdEngine.getDocumentToken(document));
if (token.isCancellationRequested) {
throw undefined;
}
const ranges = [];
for (const t of tokens) {
if (t.type === "paragraph_open") {
const pos = document.lineAt(t.map[1] - 1).range.end;
ranges.push(new vscode.Range(pos, pos));
}
}
return { target: 3 /* Paragraph */, ranges };
},
[4 /* Strikethrough */]: async (document, token) => {
if (token.isCancellationRequested) {
throw undefined;
}
const searchRanges = (await markdownEngine_1.mdEngine.getDocumentToken(document)).tokens
.filter(t => t.type === "inline" && t.map).map(t => t.map); // Tokens in, for example, table doesn't have `map`.
if (token.isCancellationRequested) {
throw undefined;
}
const ranges = [];
for (const [begin, end] of searchRanges) {
const beginOffset = document.offsetAt(new vscode.Position(begin, 0));
const text = document.getText(new vscode.Range(begin, 0, end, 0));
// GitHub's definition is pretty strict. I've tried my best to simulate it.
ranges.push(...Array.from(text.matchAll(/(? {
return new vscode.Range(document.positionAt(beginOffset + m.index), document.positionAt(beginOffset + m.index + m[0].length));
}));
if (token.isCancellationRequested) {
throw undefined;
}
}
return { target: 4 /* Strikethrough */, ranges };
},
[5 /* TrailingSpace */]: (document, token) => {
return new Promise((resolve, reject) => {
token.onCancellationRequested(reject);
if (token.isCancellationRequested) {
reject();
}
const text = document.getText();
const ranges = Array.from(text.matchAll(/ +(?=[\r\n])/g), m => {
return new vscode.Range(document.positionAt(m.index), document.positionAt(m.index + m[0].length));
});
// Process the end of file case specially.
const eof = text.match(/ +$/);
if (eof) {
ranges.push(new vscode.Range(document.positionAt(eof.index), document.positionAt(eof.index + eof[0].length)));
}
resolve({ target: 5 /* TrailingSpace */, ranges });
});
},
};
exports.default = decorationWorkerRegistry;
/***/ }),
/***/ "./src/toc.ts":
/*!********************!*\
!*** ./src/toc.ts ***!
\********************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.getAllTocEntry = exports.getAllRootHeading = exports.activate = void 0;
const path = __webpack_require__(/*! path */ "path");
const stringSimilarity = __webpack_require__(/*! string-similarity */ "./node_modules/string-similarity/src/index.js");
const vscode_1 = __webpack_require__(/*! vscode */ "vscode");
const markdownEngine_1 = __webpack_require__(/*! ./markdownEngine */ "./src/markdownEngine.ts");
const generic_1 = __webpack_require__(/*! ./util/generic */ "./src/util/generic.ts");
const slugify_1 = __webpack_require__(/*! ./util/slugify */ "./src/util/slugify.ts");
/**
* Workspace config
*/
const docConfig = { tab: ' ', eol: '\r\n' };
const tocConfig = { startDepth: 1, endDepth: 6, listMarker: '-', orderedList: false, updateOnSave: false, plaintext: false, tabSize: 2 };
function activate(context) {
context.subscriptions.push(vscode_1.commands.registerCommand('markdown.extension.toc.create', createToc), vscode_1.commands.registerCommand('markdown.extension.toc.update', updateToc), vscode_1.commands.registerCommand('markdown.extension.toc.addSecNumbers', addSectionNumbers), vscode_1.commands.registerCommand('markdown.extension.toc.removeSecNumbers', removeSectionNumbers), vscode_1.workspace.onWillSaveTextDocument(onWillSave), vscode_1.languages.registerCodeLensProvider(generic_1.Document_Selector_Markdown, new TocCodeLensProvider()));
}
exports.activate = activate;
//#region TOC operation entrance
async function createToc() {
const editor = vscode_1.window.activeTextEditor;
if (!(0, generic_1.isMdEditor)(editor)) {
return;
}
loadTocConfig(editor);
let toc = await generateTocText(editor.document);
await editor.edit(function (editBuilder) {
editBuilder.delete(editor.selection);
editBuilder.insert(editor.selection.active, toc);
});
}
async function updateToc() {
const editor = vscode_1.window.activeTextEditor;
if (!(0, generic_1.isMdEditor)(editor)) {
return;
}
loadTocConfig(editor);
const doc = editor.document;
const tocRangesAndText = await detectTocRanges(doc);
const tocRanges = tocRangesAndText[0];
const newToc = tocRangesAndText[1];
await editor.edit(editBuilder => {
for (const tocRange of tocRanges) {
if (tocRange !== null) {
const oldToc = doc.getText(tocRange).replace(/\r?\n|\r/g, docConfig.eol);
if (oldToc !== newToc) {
const unchangedLength = commonPrefixLength(oldToc, newToc);
const newStart = doc.positionAt(doc.offsetAt(tocRange.start) + unchangedLength);
const replaceRange = tocRange.with(newStart);
if (replaceRange.isEmpty) {
editBuilder.insert(replaceRange.start, newToc.substring(unchangedLength));
}
else {
editBuilder.replace(replaceRange, newToc.substring(unchangedLength));
}
}
}
}
});
}
function addSectionNumbers() {
const editor = vscode_1.window.activeTextEditor;
if (!(0, generic_1.isMdEditor)(editor)) {
return;
}
loadTocConfig(editor);
const doc = editor.document;
const toc = getAllRootHeading(doc, true, true)
.filter(i => i.canInToc && i.level >= tocConfig.startDepth && i.level <= tocConfig.endDepth);
if (toc.length === 0) {
return;
}
const startDepth = Math.max(tocConfig.startDepth, Math.min(...toc.map(h => h.level)));
let secNumbers = [0, 0, 0, 0, 0, 0];
let edit = new vscode_1.WorkspaceEdit();
toc.forEach(entry => {
const level = entry.level;
const lineNum = entry.lineIndex;
secNumbers[level - 1] += 1;
secNumbers.fill(0, level);
const secNumStr = [...Array(level - startDepth + 1).keys()].map(num => `${secNumbers[num + startDepth - 1]}.`).join('');
const lineText = doc.lineAt(lineNum).text;
const newText = lineText.includes('#')
? lineText.replace(/^(\s{0,3}#+ +)((?:\d{1,9}\.)* )?(.*)/, (_, g1, _g2, g3) => `${g1}${secNumStr} ${g3}`)
: lineText.replace(/^(\s{0,3})((?:\d{1,9}\.)* )?(.*)/, (_, g1, _g2, g3) => `${g1}${secNumStr} ${g3}`);
edit.replace(doc.uri, doc.lineAt(lineNum).range, newText);
});
return vscode_1.workspace.applyEdit(edit);
}
function removeSectionNumbers() {
const editor = vscode_1.window.activeTextEditor;
if (!(0, generic_1.isMdEditor)(editor)) {
return;
}
const doc = editor.document;
const toc = getAllRootHeading(doc, false, false);
let edit = new vscode_1.WorkspaceEdit();
toc.forEach(entry => {
const lineNum = entry.lineIndex;
const lineText = doc.lineAt(lineNum).text;
const newText = lineText.includes('#')
? lineText.replace(/^(\s{0,3}#+ +)((?:\d{1,9}\.)* )?(.*)/, (_, g1, _g2, g3) => `${g1}${g3}`)
: lineText.replace(/^(\s{0,3})((?:\d{1,9}\.)* )?(.*)/, (_, g1, _g2, g3) => `${g1}${g3}`);
edit.replace(doc.uri, doc.lineAt(lineNum).range, newText);
});
return vscode_1.workspace.applyEdit(edit);
}
function onWillSave(e) {
if (!tocConfig.updateOnSave) {
return;
}
if (e.document.languageId === 'markdown') {
e.waitUntil(updateToc());
}
}
//#endregion TOC operation entrance
/**
* Returns a list of user defined excluded headings for the given document.
* They are defined in the `toc.omittedFromToc` setting.
* @param doc The document.
*/
function getProjectExcludedHeadings(doc) {
const configObj = vscode_1.workspace.getConfiguration('markdown.extension.toc').get('omittedFromToc');
if (typeof configObj !== 'object' || configObj === null) {
vscode_1.window.showErrorMessage(`\`omittedFromToc\` must be an object (e.g. \`{"README.md": ["# Introduction"]}\`)`);
return [];
}
const docUriString = doc.uri.toString();
const docWorkspace = vscode_1.workspace.getWorkspaceFolder(doc.uri);
const workspaceUri = docWorkspace ? docWorkspace.uri : undefined;
// A few possible duplicate entries are bearable, thus, an array is enough.
const omittedHeadings = [];
for (const filePath of Object.keys(configObj)) {
let entryUri;
// Convert file system path to VS Code Uri.
if (path.isAbsolute(filePath)) {
entryUri = vscode_1.Uri.file(filePath);
}
else if (workspaceUri !== undefined) {
entryUri = vscode_1.Uri.joinPath(workspaceUri, filePath);
}
else {
continue; // Discard this entry.
}
// If the entry matches the document, read it.
if (entryUri.toString() === docUriString) {
if (Array.isArray(configObj[filePath])) {
omittedHeadings.push(...configObj[filePath]);
}
else {
vscode_1.window.showErrorMessage('Each property value of `omittedFromToc` setting must be a string array.');
}
}
}
return omittedHeadings.map(heading => {
const matches = heading.match(/^ {0,3}(#{1,6})[ \t]+(.*)$/);
if (matches === null) {
vscode_1.window.showErrorMessage(`Invalid entry "${heading}" in \`omittedFromToc\``);
return { level: -1, text: '' };
}
const [, sharps, name] = matches;
return {
level: sharps.length,
text: name
};
});
}
/**
* Generates the Markdown text representation of the TOC.
*/
// TODO: Redesign data structure to solve another bunch of bugs.
async function generateTocText(doc) {
const orderedListMarkerIsOne = vscode_1.workspace.getConfiguration('markdown.extension.orderedList').get('marker') === 'one';
const toc = [];
const tocEntries = getAllTocEntry(doc, { respectMagicCommentOmit: true, respectProjectLevelOmit: true })
.filter(i => i.canInToc && i.level >= tocConfig.startDepth && i.level <= tocConfig.endDepth); // Filter out excluded headings.
if (tocEntries.length === 0) {
return '';
}
// The actual level range of a document can be smaller than settings. So we need to calculate the real start level.
const startDepth = Math.max(tocConfig.startDepth, Math.min(...tocEntries.map(h => h.level)));
// Order counter for each heading level (from startDepth to endDepth), used only for ordered list
const orderCounter = new Array(tocConfig.endDepth - startDepth + 1).fill(0);
tocEntries.forEach(entry => {
const relativeLevel = entry.level - startDepth;
const currHeadingOrder = ++orderCounter[relativeLevel];
let indentationFix = '';
if (tocConfig.orderedList) {
const shift = orderCounter.slice(0, relativeLevel).map(c => String(c).length - 1).reduce((a, b) => a + b, 0);
indentationFix = ' '.repeat(shift);
}
const row = [
docConfig.tab.repeat(relativeLevel) + indentationFix,
(tocConfig.orderedList ? (orderedListMarkerIsOne ? '1' : currHeadingOrder) + '.' : tocConfig.listMarker) + ' ',
tocConfig.plaintext ? entry.visibleText : `[${entry.visibleText}](#${entry.slug})`
];
toc.push(row.join(''));
// Reset order counter for its sub-headings
if (tocConfig.orderedList) {
orderCounter.fill(0, relativeLevel + 1);
}
});
while (/^[ \t]/.test(toc[0])) {
toc.shift();
}
toc.push(''); // Ensure the TOC text always ends with an EOL.
return toc.join(docConfig.eol);
}
/**
* Returns an array of TOC ranges.
* If no TOC is found, returns an empty array.
* @param doc a TextDocument
*/
async function detectTocRanges(doc) {
const docTokens = (await markdownEngine_1.mdEngine.getDocumentToken(doc)).tokens;
/**
* `[beginLineIndex, endLineIndex, openingTokenIndex]`
*/
const candidateLists = docTokens.reduce((result, token, index) => {
if (token.level === 0
&& (token.type === 'bullet_list_open'
|| (token.type === 'ordered_list_open' && token.attrGet('start') === null))) {
result.push([...token.map, index]);
}
return result;
}, []);
const tocRanges = [];
const newTocText = await generateTocText(doc);
for (const item of candidateLists) {
const beginLineIndex = item[0];
let endLineIndex = item[1];
const opTokenIndex = item[2];
//// #525 comment
if (beginLineIndex > 0
&& doc.lineAt(beginLineIndex - 1).text === '') {
continue;
}
// Check the first list item to see if it could be a TOC.
//
// ## Token stream
//
// +3 alway exists, even if it's an empty list.
// In a target, +3 is `inline`:
//
// opTokenIndex: *_list_open
// +1: list_item_open
// +2: paragraph_open
// +3: inline
// +4: paragraph_close
// ...
// ...: list_item_close
//
// ## `inline.children`
//
// Ordinary TOC: `link_open`, ..., `link_close`.
// Plain text TOC: No `link_*` tokens.
const firstItemContent = docTokens[opTokenIndex + 3];
if (firstItemContent.type !== 'inline') {
continue;
}
const tokens = firstItemContent.children;
if (vscode_1.workspace.getConfiguration('markdown.extension.toc').get('plaintext')) {
if (tokens.some(t => t.type.startsWith('link_'))) {
continue;
}
}
else {
if (!(tokens[0].type === 'link_open'
&& tokens[0].attrGet('href').startsWith('#') // Destination begins with `#`. (#304)
&& tokens.findIndex(t => t.type === 'link_close') === (tokens.length - 1) // Only one link. (#549, #683)
)) {
continue;
}
}
// The original range may have trailing white lines.
while (doc.lineAt(endLineIndex - 1).isEmptyOrWhitespace) {
endLineIndex--;
}
const finalRange = new vscode_1.Range(new vscode_1.Position(beginLineIndex, 0), new vscode_1.Position(endLineIndex, 0));
const listText = doc.getText(finalRange);
if (radioOfCommonPrefix(newTocText, listText) + stringSimilarity.compareTwoStrings(newTocText, listText) > 0.5) {
tocRanges.push(finalRange);
}
}
return [tocRanges, newTocText];
}
function commonPrefixLength(s1, s2) {
let minLength = Math.min(s1.length, s2.length);
for (let i = 0; i < minLength; i++) {
if (s1[i] !== s2[i]) {
return i;
}
}
return minLength;
}
function radioOfCommonPrefix(s1, s2) {
let minLength = Math.min(s1.length, s2.length);
let maxLength = Math.max(s1.length, s2.length);
let prefixLength = commonPrefixLength(s1, s2);
if (prefixLength < minLength) {
return prefixLength / minLength;
}
else {
return minLength / maxLength;
}
}
/**
* Updates `tocConfig` and `docConfig`.
* @param editor The editor, from which we detect `docConfig`.
*/
function loadTocConfig(editor) {
const tocSectionCfg = vscode_1.workspace.getConfiguration('markdown.extension.toc');
const tocLevels = tocSectionCfg.get('levels');
let matches;
if (matches = tocLevels.match(/^([1-6])\.\.([1-6])$/)) {
tocConfig.startDepth = Number(matches[1]);
tocConfig.endDepth = Number(matches[2]);
}
tocConfig.orderedList = tocSectionCfg.get('orderedList');
tocConfig.listMarker = tocSectionCfg.get('unorderedList.marker');
tocConfig.plaintext = tocSectionCfg.get('plaintext');
tocConfig.updateOnSave = tocSectionCfg.get('updateOnSave');
// Load workspace config
docConfig.eol = editor.document.eol === vscode_1.EndOfLine.CRLF ? '\r\n' : '\n';
let tabSize = Number(editor.options.tabSize);
// Seems not robust.
if (vscode_1.workspace.getConfiguration('markdown.extension.list', editor.document.uri).get('indentationSize') === 'adaptive') {
tabSize = tocConfig.orderedList ? 3 : 2;
}
const insertSpaces = editor.options.insertSpaces;
if (insertSpaces) {
docConfig.tab = ' '.repeat(tabSize);
}
else {
docConfig.tab = '\t';
}
}
/**
* Extracts those that can be rendered to visible text from a string of CommonMark **inline** structures,
* to create a single line string which can be safely used as **link text**.
*
* The result cannot be directly used as the content of a paragraph,
* since this function does not escape all sequences that look like block structures.
*
* We roughly take GitLab's `[[_TOC_]]` as reference.
*
* @param raw - The Markdown string.
* @param env - The markdown-it environment sandbox (**mutable**).
* @returns A single line string, which only contains plain textual content,
* backslash escape, code span, and emphasis.
*/
function createLinkText(raw, env) {
const inlineTokens = markdownEngine_1.commonMarkEngine.engine.parseInline(raw, env)[0].children;
return inlineTokens.reduce((result, token) => {
switch (token.type) {
case "text":
return result + token.content.replace(/[&*<>\[\\\]_`]/g, "\\$&"); // Escape.
case "code_inline":
return result + token.markup + token.content + token.markup; // Emit as is.
case "strong_open":
case "strong_close":
case "em_open":
case "em_close":
return result + token.markup; // Preserve emphasis indicators.
case "link_open":
case "link_close":
case "image":
case "html_inline":
return result; // Discard them.
case "softbreak":
case "hardbreak":
return result + " "; // Replace line breaks with spaces.
default:
return result + token.content;
}
}, "");
}
//#region Public utility
/**
* Gets all headings in the root of the text document.
*
* The optional parameters default to `false`.
* @returns In ascending order of `lineIndex`.
*/
function getAllRootHeading(doc, respectMagicCommentOmit = false, respectProjectLevelOmit = false) {
/**
* Replaces line content with empty.
* @param foundStr The multiline string.
*/
const replacer = (foundStr) => foundStr.replace(/[^\r\n]/g, '');
/*
* Text normalization
* ==================
* including:
*
* 1. (easy) YAML front matter, tab to spaces, HTML comment, Markdown fenced code blocks
* 2. (complex) Setext headings to ATX headings
* 3. Remove trailing space or tab characters.
*
* Note:
* When recognizing or trimming whitespace characters, comply with the CommonMark Spec.
* Do not use anything that defines whitespace as per ECMAScript, like `trim()`.
*/
// (easy)
const lines = doc.getText()
.replace(/^---.+?(?:\r?\n)---(?=[ \t]*\r?\n)/s, replacer) //// Remove YAML front matter
.replace(/^\t+/gm, (match) => ' '.repeat(match.length)) //
.replace(/^( {0,3}).*$/gm, (match, leading, content) => {
// Remove HTML block comment, together with all the text in the lines it occupies.
// Exclude our magic comment.
if (leading.length === 0 && /omit (in|from) toc/.test(content)) {
return match;
}
else {
return replacer(match);
}
})
.replace(generic_1.Regexp_Fenced_Code_Block, replacer) //// Remove fenced code blocks (and #603, #675)
.split(/\r?\n/g);
// Do transformations as many as possible in one loop, to save time.
lines.forEach((lineText, i, arr) => {
// (complex) Setext headings to ATX headings.
// Still cannot perfectly handle some weird cases, for example:
// * Multiline heading.
// * A setext heading next to a list.
if (i < arr.length - 1 // The current line is not the last.
&& /^ {0,3}(?:=+|-+)[ \t]*$/.test(arr[i + 1]) // The next line is a setext heading underline.
&& /^ {0,3}[^ \t\f\v]/.test(lineText) // The indentation of the line is 0~3.
&& !/^ {0,3}#{1,6}(?: |\t|$)/.test(lineText) // The line is not an ATX heading.
&& !/^ {0,3}(?:[*+-]|\d{1,9}(?:\.|\)))(?: |\t|$)/.test(lineText) // The line is not a list item.
&& !/^ {0,3}>/.test(lineText) // The line is not a block quote.
// #629: Consecutive thematic breaks false positive.
&& !/^ {0,3}(?:(?:-[ \t]*){3,}|(?:\*[ \t]*){3,}|(?:_[ \t]*){3,})[ \t]*$/.test(lineText)) {
arr[i] = (arr[i + 1].includes('=') ? '# ' : '## ') + lineText;
arr[i + 1] = '';
}
// Remove trailing space or tab characters.
// Since they have no effect on subsequent operations, and removing them can simplify those operations.
//
arr[i] = arr[i].replace(/[ \t]+$/, '');
});
/*
* Mark omitted headings
* =====================
*
* - headings with magic comment `` (on their own)
* - headings from `getProjectExcludedHeadings()` (and their subheadings)
*
* Note:
* * We have trimmed trailing space or tab characters for every line above.
* * We have performed leading tab-space conversion above.
*/
const projectLevelOmittedHeadings = respectProjectLevelOmit ? getProjectExcludedHeadings(doc) : [];
/**
* Keep track of the omitted heading's depth to also omit its subheadings.
* This is only for project level omitting.
*/
let ignoredDepthBound = undefined;
const toc = [];
for (let i = 0; i < lines.length; i++) {
const crtLineText = lines[i];
// Skip non-ATX heading lines.
if (
//
!/^ {0,3}#{1,6}(?: |\t|$)/.test(crtLineText)) {
continue;
}
// Extract heading info.
const matches = /^ {0,3}(#{1,6})(.*)$/.exec(crtLineText);
const entry = {
level: matches[1].length,
rawContent: matches[2].replace(/^[ \t]+/, '').replace(/[ \t]+#+[ \t]*$/, ''),
lineIndex: i,
canInToc: true,
};
// Omit because of magic comment
if (respectMagicCommentOmit
&& entry.canInToc
&& (
// The magic comment is above the heading.
(i > 0
&& /^$/.test(lines[i - 1]))
// The magic comment is at the end of the heading.
|| /$/.test(crtLineText))) {
entry.canInToc = false;
}
// Omit because of `projectLevelOmittedHeadings`.
if (respectProjectLevelOmit && entry.canInToc) {
// Whether omitted as a subheading
if (ignoredDepthBound !== undefined
&& entry.level > ignoredDepthBound) {
entry.canInToc = false;
}
// Whether omitted because it is in `projectLevelOmittedHeadings`.
if (entry.canInToc) {
if (projectLevelOmittedHeadings.some(({ level, text }) => level === entry.level && text === entry.rawContent)) {
entry.canInToc = false;
ignoredDepthBound = entry.level;
}
else {
// Otherwise reset ignore bound.
ignoredDepthBound = undefined;
}
}
}
toc.push(entry);
}
return toc;
}
exports.getAllRootHeading = getAllRootHeading;
/**
* Gets all headings in the root of the text document, with additional TOC specific properties.
* @returns In ascending order of `lineIndex`.
*/
function getAllTocEntry(doc, { respectMagicCommentOmit = false, respectProjectLevelOmit = false, slugifyMode = vscode_1.workspace.getConfiguration('markdown.extension.toc').get('slugifyMode'), }) {
const rootHeadings = getAllRootHeading(doc, respectMagicCommentOmit, respectProjectLevelOmit);
const { env } = markdownEngine_1.commonMarkEngine.getDocumentToken(doc);
const anchorOccurrences = new Map();
function getSlug(rawContent) {
let slug = (0, slugify_1.slugify)(rawContent, { env, mode: slugifyMode });
let count = anchorOccurrences.get(slug);
if (count === undefined) {
anchorOccurrences.set(slug, 0);
}
else {
count++;
anchorOccurrences.set(slug, count);
slug += '-' + count.toString();
}
return slug;
}
const toc = rootHeadings.map((heading) => ({
level: heading.level,
rawContent: heading.rawContent,
lineIndex: heading.lineIndex,
canInToc: heading.canInToc,
visibleText: createLinkText(heading.rawContent, env),
slug: getSlug(heading.rawContent),
}));
return toc;
}
exports.getAllTocEntry = getAllTocEntry;
//#endregion Public utility
class TocCodeLensProvider {
provideCodeLenses(document, _) {
// VS Code asks for code lens as soon as a text editor is visible (atop the group that holds it), no matter whether it has focus.
// Duplicate editor views refer to the same TextEditor, and the same TextDocument.
const editor = vscode_1.window.visibleTextEditors.find(e => e.document === document);
loadTocConfig(editor);
const lenses = [];
return detectTocRanges(document).then(tocRangesAndText => {
const tocRanges = tocRangesAndText[0];
const newToc = tocRangesAndText[1];
for (let tocRange of tocRanges) {
let status = document.getText(tocRange).replace(/\r?\n|\r/g, docConfig.eol) === newToc ? 'up to date' : 'out of date';
lenses.push(new vscode_1.CodeLens(tocRange, {
arguments: [],
title: `Table of Contents (${status})`,
command: ''
}));
}
return lenses;
});
}
}
/***/ }),
/***/ "./src/util/contextCheck.ts":
/*!**********************************!*\
!*** ./src/util/contextCheck.ts ***!
\**********************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.mathEnvCheck = exports.isInFencedCodeBlock = void 0;
const markdownEngine_1 = __webpack_require__(/*! ../markdownEngine */ "./src/markdownEngine.ts");
/**
* Checks whether the line is in a fenced code block.
* @param lineIndex The zero-based line index.
*/
function isInFencedCodeBlock(doc, lineIndex) {
const { tokens } = markdownEngine_1.commonMarkEngine.getDocumentToken(doc);
for (const token of tokens) {
if (token.type === "fence"
&& token.tag === "code"
&& token.map[0] <= lineIndex
&& lineIndex < token.map[1]) {
return true;
}
}
return false;
}
exports.isInFencedCodeBlock = isInFencedCodeBlock;
function mathEnvCheck(doc, pos) {
const docText = doc.getText();
const crtOffset = doc.offsetAt(pos);
const crtLine = doc.lineAt(pos.line);
const lineTextBefore = crtLine.text.substring(0, pos.character);
const lineTextAfter = crtLine.text.substring(pos.character);
if (/(?:^|[^\$])\$(?:[^ \$].*)??\\\w*$/.test(lineTextBefore)
&& lineTextAfter.includes("$")) {
// Inline math
return "inline";
}
else {
const textBefore = docText.substring(0, crtOffset);
const textAfter = docText.substring(crtOffset);
let matches = textBefore.match(/\$\$/g);
if (matches !== null
&& matches.length % 2 !== 0
&& textAfter.includes("$$")) {
// $$ ... $$
return "display";
}
else {
return "";
}
}
}
exports.mathEnvCheck = mathEnvCheck;
/***/ }),
/***/ "./src/util/generic.ts":
/*!*****************************!*\
!*** ./src/util/generic.ts ***!
\*****************************/
/***/ ((__unused_webpack_module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.isMdEditor = exports.Regexp_Fenced_Code_Block = exports.Document_Selector_Markdown = void 0;
/** Scheme `File` or `Untitled` */
exports.Document_Selector_Markdown = [
{ language: "markdown" /* Markdown */, scheme: "file" },
{ language: "markdown" /* Markdown */, scheme: "untitled" },
];
/**
* **Do not call `exec()` method, to avoid accidentally changing its state!**
*
* Match most kinds of fenced code blocks:
*
* * Only misses .
* * Due to the limitations of regular expression, the "end of the document" cases are not handled.
*/
exports.Regexp_Fenced_Code_Block = /^ {0,3}(?(?[`~])\k{2,})[^`\r\n]*$[^]*?^ {0,3}\k\k* *$/gm;
function isMdEditor(editor) {
return !!(editor && editor.document && editor.document.languageId === "markdown" /* Markdown */);
}
exports.isMdEditor = isMdEditor;
/***/ }),
/***/ "./src/util/lazy.ts":
/*!**************************!*\
!*** ./src/util/lazy.ts ***!
\**************************/
/***/ ((__unused_webpack_module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.Lazy = void 0;
/**
* @see {@link https://docs.microsoft.com/en-us/dotnet/framework/performance/lazy-initialization}
*/
class Lazy {
constructor(factory) {
this._isValueCreated = false;
this._value = null;
this._factory = factory;
}
get isValueCreated() {
return this._isValueCreated;
}
get value() {
if (!this._isValueCreated) {
this._value = this._factory();
this._isValueCreated = true;
}
return this._value;
}
}
exports.Lazy = Lazy;
/***/ }),
/***/ "./src/util/slugify.ts":
/*!*****************************!*\
!*** ./src/util/slugify.ts ***!
\*****************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.slugify = void 0;
const manager_1 = __webpack_require__(/*! ../configuration/manager */ "./src/configuration/manager.ts");
const markdownEngine_1 = __webpack_require__(/*! ../markdownEngine */ "./src/markdownEngine.ts");
const utf8Encoder = new TextEncoder();
// Converted from Ruby regular expression `/[^\p{Word}\- ]/u`
// `\p{Word}` => Letter (Ll/Lm/Lo/Lt/Lu), Mark (Mc/Me/Mn), Number (Nd/Nl), Connector_Punctuation (Pc)
// It's weird that Ruby's `\p{Word}` actually does not include Category No.
// https://ruby-doc.org/core/Regexp.html
// https://rubular.com/r/ThqXAm370XRMz6
/**
* The definition of punctuation from GitHub and GitLab.
*/
const Regexp_Github_Punctuation = /[^\p{L}\p{M}\p{Nd}\p{Nl}\p{Pc}\- ]/gu;
const Regexp_Gitlab_Product_Suffix = /[ \t\r\n\f\v]*\**\((?:core|starter|premium|ultimate)(?:[ \t\r\n\f\v]+only)?\)\**/g;
/**
* Converts a string of CommonMark **inline** structures to plain text
* by removing Markdown syntax in it.
* This function is only for the `github` and `gitlab` slugify functions.
* @see
*
* @param text - The Markdown string.
* @param env - The markdown-it environment sandbox (**mutable**).
* If you don't provide one properly, we cannot process reference links, etc.
*/
function mdInlineToPlainText(text, env) {
// Use a clean CommonMark only engine to avoid interfering with plugins from other extensions.
// Use `parseInline` to avoid parsing the string as blocks accidentally.
// See #567, #585, #732, #792; #515; #179; #175, #575
const inlineTokens = markdownEngine_1.commonMarkEngine.engine.parseInline(text, env)[0].children;
return inlineTokens.reduce((result, token) => {
switch (token.type) {
case "image":
case "html_inline":
return result;
default:
return result + token.content;
}
}, "");
}
/**
* Slugify methods.
*
* Each key is a slugify mode.
* A values is the corresponding slugify function, whose signature must be `(rawContent: string, env: object) => string`.
*/
const Slugify_Methods = {
// Sort in alphabetical order.
["azureDevops" /* AzureDevOps */]: (slug) => {
// https://markdown-all-in-one.github.io/docs/specs/slugify/azure-devops.html
// Encode every character. Although opposed by RFC 3986, it's the only way to solve #802.
return Array.from(utf8Encoder.encode(slug
.trim()
.toLowerCase()
.replace(/\p{Zs}/gu, "-")), (b) => "%" + b.toString(16))
.join("")
.toUpperCase();
},
["bitbucket-cloud" /* BitbucketCloud */]: (slug, env) => {
// https://support.atlassian.com/bitbucket-cloud/docs/readme-content/
// https://bitbucket.org/tutorials/markdowndemo/
slug = "markdown-header-"
+ Slugify_Methods.github(slug, env).replace(/-+/g, "-");
return slug;
},
["gitea" /* Gitea */]: (slug) => {
// Gitea uses the blackfriday parser
// https://godoc.org/github.com/russross/blackfriday#hdr-Sanitized_Anchor_Names
slug = slug
.replace(/^[^\p{L}\p{N}]+/u, "")
.replace(/[^\p{L}\p{N}]+$/u, "")
.replace(/[^\p{L}\p{N}]+/gu, "-")
.toLowerCase();
return slug;
},
["github" /* GitHub */]: (slug, env) => {
// According to an inspection in 2020-12, GitHub passes the raw content as is,
// and does not trim leading or trailing C0, Zs characters in any step.
//
slug = mdInlineToPlainText(slug, env)
.replace(Regexp_Github_Punctuation, "")
.toLowerCase() // According to an inspection in 2020-09, GitHub performs full Unicode case conversion now.
.replace(/ /g, "-");
return slug;
},
["gitlab" /* GitLab */]: (slug, env) => {
// https://gitlab.com/help/user/markdown
// https://docs.gitlab.com/ee/api/markdown.html
// https://docs.gitlab.com/ee/development/wikis.html
//
// https://gitlab.com/gitlab-org/gitlab/blob/a8c5858ce940decf1d263b59b39df58f89910faf/lib/gitlab/utils/markdown.rb
slug = mdInlineToPlainText(slug, env)
.replace(/^[ \t\r\n\f\v]+/, "")
.replace(/[ \t\r\n\f\v]+$/, "") // https://ruby-doc.org/core/String.html#method-i-strip
.toLowerCase()
.replace(Regexp_Gitlab_Product_Suffix, "")
.replace(Regexp_Github_Punctuation, "")
.replace(/ /g, "-") // Replace space with dash.
.replace(/-+/g, "-") // Replace multiple/consecutive dashes with only one.
// digits-only hrefs conflict with issue refs
.replace(/^(\d+)$/, "anchor-$1");
return slug;
},
["vscode" /* VisualStudioCode */]: (rawContent, env) => {
// https://github.com/microsoft/vscode/blob/0798d13f10b193df0297e301affe761b90a8bfa9/extensions/markdown-language-features/src/slugify.ts#L22-L29
return encodeURI(
// Simulate .
// Not the same, but should cover most needs.
markdownEngine_1.commonMarkEngine.engine.parseInline(rawContent, env)[0].children
.reduce((result, token) => result + token.content, "")
.trim()
.toLowerCase()
.replace(/\s+/g, "-") // Replace whitespace with -
.replace(/[\]\[\!\'\#\$\%\&\(\)\*\+\,\.\/\:\;\<\=\>\?\@\\\^\_\{\|\}\~\`。,、;:?!…—·ˉ¨‘’“”々~‖∶"'`|〃〔〕〈〉《》「」『』.〖〗【】()[]{}]/g, "") // Remove known punctuators
.replace(/^\-+/, "") // Remove leading -
.replace(/\-+$/, "") // Remove trailing -
);
}
};
/**
* Slugify a string.
* @param heading - The raw content of the heading according to the CommonMark Spec.
* @param env - The markdown-it environment sandbox (**mutable**).
* @param mode - The slugify mode.
*/
function slugify(heading, { env = Object.create(null), mode = manager_1.configManager.get("toc.slugifyMode"), }) {
// Do never twist the input here!
// Pass the raw heading content as is to slugify function.
// Sort by popularity.
switch (mode) {
case "github" /* GitHub */:
return Slugify_Methods["github" /* GitHub */](heading, env);
case "gitlab" /* GitLab */:
return Slugify_Methods["gitlab" /* GitLab */](heading, env);
case "gitea" /* Gitea */:
return Slugify_Methods["gitea" /* Gitea */](heading, env);
case "vscode" /* VisualStudioCode */:
return Slugify_Methods["vscode" /* VisualStudioCode */](heading, env);
case "azureDevops" /* AzureDevOps */:
return Slugify_Methods["azureDevops" /* AzureDevOps */](heading, env);
case "bitbucket-cloud" /* BitbucketCloud */:
return Slugify_Methods["bitbucket-cloud" /* BitbucketCloud */](heading, env);
default:
return Slugify_Methods["github" /* GitHub */](heading, env);
}
}
exports.slugify = slugify;
/***/ }),
/***/ "./node_modules/uc.micro/categories/Cc/regex.js":
/*!******************************************************!*\
!*** ./node_modules/uc.micro/categories/Cc/regex.js ***!
\******************************************************/
/***/ ((module) => {
module.exports=/[\0-\x1F\x7F-\x9F]/
/***/ }),
/***/ "./node_modules/uc.micro/categories/Cf/regex.js":
/*!******************************************************!*\
!*** ./node_modules/uc.micro/categories/Cf/regex.js ***!
\******************************************************/
/***/ ((module) => {
module.exports=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/
/***/ }),
/***/ "./node_modules/uc.micro/categories/P/regex.js":
/*!*****************************************************!*\
!*** ./node_modules/uc.micro/categories/P/regex.js ***!
\*****************************************************/
/***/ ((module) => {
module.exports=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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\u09FD\u0A76\u0AF0\u0C84\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-\u2E4E\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]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/
/***/ }),
/***/ "./node_modules/uc.micro/categories/Z/regex.js":
/*!*****************************************************!*\
!*** ./node_modules/uc.micro/categories/Z/regex.js ***!
\*****************************************************/
/***/ ((module) => {
module.exports=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/
/***/ }),
/***/ "./node_modules/uc.micro/index.js":
/*!****************************************!*\
!*** ./node_modules/uc.micro/index.js ***!
\****************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
exports.Any = __webpack_require__(/*! ./properties/Any/regex */ "./node_modules/uc.micro/properties/Any/regex.js");
exports.Cc = __webpack_require__(/*! ./categories/Cc/regex */ "./node_modules/uc.micro/categories/Cc/regex.js");
exports.Cf = __webpack_require__(/*! ./categories/Cf/regex */ "./node_modules/uc.micro/categories/Cf/regex.js");
exports.P = __webpack_require__(/*! ./categories/P/regex */ "./node_modules/uc.micro/categories/P/regex.js");
exports.Z = __webpack_require__(/*! ./categories/Z/regex */ "./node_modules/uc.micro/categories/Z/regex.js");
/***/ }),
/***/ "./node_modules/uc.micro/properties/Any/regex.js":
/*!*******************************************************!*\
!*** ./node_modules/uc.micro/properties/Any/regex.js ***!
\*******************************************************/
/***/ ((module) => {
module.exports=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/
/***/ }),
/***/ "events":
/*!*************************!*\
!*** external "events" ***!
\*************************/
/***/ ((module) => {
"use strict";
module.exports = require("events");
/***/ }),
/***/ "fs":
/*!*********************!*\
!*** external "fs" ***!
\*********************/
/***/ ((module) => {
"use strict";
module.exports = require("fs");
/***/ }),
/***/ "path":
/*!***********************!*\
!*** external "path" ***!
\***********************/
/***/ ((module) => {
"use strict";
module.exports = require("path");
/***/ }),
/***/ "punycode":
/*!***************************!*\
!*** external "punycode" ***!
\***************************/
/***/ ((module) => {
"use strict";
module.exports = require("punycode");
/***/ }),
/***/ "util":
/*!***********************!*\
!*** external "util" ***!
\***********************/
/***/ ((module) => {
"use strict";
module.exports = require("util");
/***/ }),
/***/ "vscode":
/*!*************************!*\
!*** external "vscode" ***!
\*************************/
/***/ ((module) => {
"use strict";
module.exports = require("vscode");
/***/ }),
/***/ "./node_modules/highlight.js/lib/core.js":
/*!***********************************************!*\
!*** ./node_modules/highlight.js/lib/core.js ***!
\***********************************************/
/***/ ((module) => {
var deepFreezeEs6 = {exports: {}};
function deepFreeze(obj) {
if (obj instanceof Map) {
obj.clear = obj.delete = obj.set = function () {
throw new Error('map is read-only');
};
} else if (obj instanceof Set) {
obj.add = obj.clear = obj.delete = function () {
throw new Error('set is read-only');
};
}
// Freeze self
Object.freeze(obj);
Object.getOwnPropertyNames(obj).forEach(function (name) {
var prop = obj[name];
// Freeze prop if it is an object
if (typeof prop == 'object' && !Object.isFrozen(prop)) {
deepFreeze(prop);
}
});
return obj;
}
deepFreezeEs6.exports = deepFreeze;
deepFreezeEs6.exports.default = deepFreeze;
var deepFreeze$1 = deepFreezeEs6.exports;
/** @typedef {import('highlight.js').CallbackResponse} CallbackResponse */
/** @typedef {import('highlight.js').CompiledMode} CompiledMode */
/** @implements CallbackResponse */
class Response {
/**
* @param {CompiledMode} mode
*/
constructor(mode) {
// eslint-disable-next-line no-undefined
if (mode.data === undefined) mode.data = {};
this.data = mode.data;
this.isMatchIgnored = false;
}
ignoreMatch() {
this.isMatchIgnored = true;
}
}
/**
* @param {string} value
* @returns {string}
*/
function escapeHTML(value) {
return value
.replace(/&/g, '&')
.replace(//g, '>')
.replace(/"/g, '"')
.replace(/'/g, ''');
}
/**
* performs a shallow merge of multiple objects into one
*
* @template T
* @param {T} original
* @param {Record[]} objects
* @returns {T} a single new object
*/
function inherit$1(original, ...objects) {
/** @type Record */
const result = Object.create(null);
for (const key in original) {
result[key] = original[key];
}
objects.forEach(function(obj) {
for (const key in obj) {
result[key] = obj[key];
}
});
return /** @type {T} */ (result);
}
/**
* @typedef {object} Renderer
* @property {(text: string) => void} addText
* @property {(node: Node) => void} openNode
* @property {(node: Node) => void} closeNode
* @property {() => string} value
*/
/** @typedef {{kind?: string, sublanguage?: boolean}} Node */
/** @typedef {{walk: (r: Renderer) => void}} Tree */
/** */
const SPAN_CLOSE = '';
/**
* Determines if a node needs to be wrapped in
*
* @param {Node} node */
const emitsWrappingTags = (node) => {
return !!node.kind;
};
/**
*
* @param {string} name
* @param {{prefix:string}} options
*/
const expandScopeName = (name, { prefix }) => {
if (name.includes(".")) {
const pieces = name.split(".");
return [
`${prefix}${pieces.shift()}`,
...(pieces.map((x, i) => `${x}${"_".repeat(i + 1)}`))
].join(" ");
}
return `${prefix}${name}`;
};
/** @type {Renderer} */
class HTMLRenderer {
/**
* Creates a new HTMLRenderer
*
* @param {Tree} parseTree - the parse tree (must support `walk` API)
* @param {{classPrefix: string}} options
*/
constructor(parseTree, options) {
this.buffer = "";
this.classPrefix = options.classPrefix;
parseTree.walk(this);
}
/**
* Adds texts to the output stream
*
* @param {string} text */
addText(text) {
this.buffer += escapeHTML(text);
}
/**
* Adds a node open to the output stream (if needed)
*
* @param {Node} node */
openNode(node) {
if (!emitsWrappingTags(node)) return;
let scope = node.kind;
if (node.sublanguage) {
scope = `language-${scope}`;
} else {
scope = expandScopeName(scope, { prefix: this.classPrefix });
}
this.span(scope);
}
/**
* Adds a node close to the output stream (if needed)
*
* @param {Node} node */
closeNode(node) {
if (!emitsWrappingTags(node)) return;
this.buffer += SPAN_CLOSE;
}
/**
* returns the accumulated buffer
*/
value() {
return this.buffer;
}
// helpers
/**
* Builds a span element
*
* @param {string} className */
span(className) {
this.buffer += ``;
}
}
/** @typedef {{kind?: string, sublanguage?: boolean, children: Node[]} | string} Node */
/** @typedef {{kind?: string, sublanguage?: boolean, children: Node[]} } DataNode */
/** @typedef {import('highlight.js').Emitter} Emitter */
/** */
class TokenTree {
constructor() {
/** @type DataNode */
this.rootNode = { children: [] };
this.stack = [this.rootNode];
}
get top() {
return this.stack[this.stack.length - 1];
}
get root() { return this.rootNode; }
/** @param {Node} node */
add(node) {
this.top.children.push(node);
}
/** @param {string} kind */
openNode(kind) {
/** @type Node */
const node = { kind, children: [] };
this.add(node);
this.stack.push(node);
}
closeNode() {
if (this.stack.length > 1) {
return this.stack.pop();
}
// eslint-disable-next-line no-undefined
return undefined;
}
closeAllNodes() {
while (this.closeNode());
}
toJSON() {
return JSON.stringify(this.rootNode, null, 4);
}
/**
* @typedef { import("./html_renderer").Renderer } Renderer
* @param {Renderer} builder
*/
walk(builder) {
// this does not
return this.constructor._walk(builder, this.rootNode);
// this works
// return TokenTree._walk(builder, this.rootNode);
}
/**
* @param {Renderer} builder
* @param {Node} node
*/
static _walk(builder, node) {
if (typeof node === "string") {
builder.addText(node);
} else if (node.children) {
builder.openNode(node);
node.children.forEach((child) => this._walk(builder, child));
builder.closeNode(node);
}
return builder;
}
/**
* @param {Node} node
*/
static _collapse(node) {
if (typeof node === "string") return;
if (!node.children) return;
if (node.children.every(el => typeof el === "string")) {
// node.text = node.children.join("");
// delete node.children;
node.children = [node.children.join("")];
} else {
node.children.forEach((child) => {
TokenTree._collapse(child);
});
}
}
}
/**
Currently this is all private API, but this is the minimal API necessary
that an Emitter must implement to fully support the parser.
Minimal interface:
- addKeyword(text, kind)
- addText(text)
- addSublanguage(emitter, subLanguageName)
- finalize()
- openNode(kind)
- closeNode()
- closeAllNodes()
- toHTML()
*/
/**
* @implements {Emitter}
*/
class TokenTreeEmitter extends TokenTree {
/**
* @param {*} options
*/
constructor(options) {
super();
this.options = options;
}
/**
* @param {string} text
* @param {string} kind
*/
addKeyword(text, kind) {
if (text === "") { return; }
this.openNode(kind);
this.addText(text);
this.closeNode();
}
/**
* @param {string} text
*/
addText(text) {
if (text === "") { return; }
this.add(text);
}
/**
* @param {Emitter & {root: DataNode}} emitter
* @param {string} name
*/
addSublanguage(emitter, name) {
/** @type DataNode */
const node = emitter.root;
node.kind = name;
node.sublanguage = true;
this.add(node);
}
toHTML() {
const renderer = new HTMLRenderer(this, this.options);
return renderer.value();
}
finalize() {
return true;
}
}
/**
* @param {string} value
* @returns {RegExp}
* */
/**
* @param {RegExp | string } re
* @returns {string}
*/
function source(re) {
if (!re) return null;
if (typeof re === "string") return re;
return re.source;
}
/**
* @param {RegExp | string } re
* @returns {string}
*/
function lookahead(re) {
return concat('(?=', re, ')');
}
/**
* @param {RegExp | string } re
* @returns {string}
*/
function anyNumberOfTimes(re) {
return concat('(?:', re, ')*');
}
/**
* @param {RegExp | string } re
* @returns {string}
*/
function optional(re) {
return concat('(?:', re, ')?');
}
/**
* @param {...(RegExp | string) } args
* @returns {string}
*/
function concat(...args) {
const joined = args.map((x) => source(x)).join("");
return joined;
}
/**
* @param { Array } args
* @returns {object}
*/
function stripOptionsFromArgs(args) {
const opts = args[args.length - 1];
if (typeof opts === 'object' && opts.constructor === Object) {
args.splice(args.length - 1, 1);
return opts;
} else {
return {};
}
}
/**
* Any of the passed expresssions may match
*
* Creates a huge this | this | that | that match
* @param {(RegExp | string)[] } args
* @returns {string}
*/
function either(...args) {
/** @type { object & {capture?: boolean} } */
const opts = stripOptionsFromArgs(args);
const joined = '('
+ (opts.capture ? "" : "?:")
+ args.map((x) => source(x)).join("|") + ")";
return joined;
}
/**
* @param {RegExp | string} re
* @returns {number}
*/
function countMatchGroups(re) {
return (new RegExp(re.toString() + '|')).exec('').length - 1;
}
/**
* Does lexeme start with a regular expression match at the beginning
* @param {RegExp} re
* @param {string} lexeme
*/
function startsWith(re, lexeme) {
const match = re && re.exec(lexeme);
return match && match.index === 0;
}
// BACKREF_RE matches an open parenthesis or backreference. To avoid
// an incorrect parse, it additionally matches the following:
// - [...] elements, where the meaning of parentheses and escapes change
// - other escape sequences, so we do not misparse escape sequences as
// interesting elements
// - non-matching or lookahead parentheses, which do not capture. These
// follow the '(' with a '?'.
const BACKREF_RE = /\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;
// **INTERNAL** Not intended for outside usage
// join logically computes regexps.join(separator), but fixes the
// backreferences so they continue to match.
// it also places each individual regular expression into it's own
// match group, keeping track of the sequencing of those match groups
// is currently an exercise for the caller. :-)
/**
* @param {(string | RegExp)[]} regexps
* @param {{joinWith: string}} opts
* @returns {string}
*/
function _rewriteBackreferences(regexps, { joinWith }) {
let numCaptures = 0;
return regexps.map((regex) => {
numCaptures += 1;
const offset = numCaptures;
let re = source(regex);
let out = '';
while (re.length > 0) {
const match = BACKREF_RE.exec(re);
if (!match) {
out += re;
break;
}
out += re.substring(0, match.index);
re = re.substring(match.index + match[0].length);
if (match[0][0] === '\\' && match[1]) {
// Adjust the backreference.
out += '\\' + String(Number(match[1]) + offset);
} else {
out += match[0];
if (match[0] === '(') {
numCaptures++;
}
}
}
return out;
}).map(re => `(${re})`).join(joinWith);
}
/** @typedef {import('highlight.js').Mode} Mode */
/** @typedef {import('highlight.js').ModeCallback} ModeCallback */
// Common regexps
const MATCH_NOTHING_RE = /\b\B/;
const IDENT_RE = '[a-zA-Z]\\w*';
const UNDERSCORE_IDENT_RE = '[a-zA-Z_]\\w*';
const NUMBER_RE = '\\b\\d+(\\.\\d+)?';
const C_NUMBER_RE = '(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)'; // 0x..., 0..., decimal, float
const BINARY_NUMBER_RE = '\\b(0b[01]+)'; // 0b...
const RE_STARTERS_RE = '!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~';
/**
* @param { Partial & {binary?: string | RegExp} } opts
*/
const SHEBANG = (opts = {}) => {
const beginShebang = /^#![ ]*\//;
if (opts.binary) {
opts.begin = concat(
beginShebang,
/.*\b/,
opts.binary,
/\b.*/);
}
return inherit$1({
scope: 'meta',
begin: beginShebang,
end: /$/,
relevance: 0,
/** @type {ModeCallback} */
"on:begin": (m, resp) => {
if (m.index !== 0) resp.ignoreMatch();
}
}, opts);
};
// Common modes
const BACKSLASH_ESCAPE = {
begin: '\\\\[\\s\\S]', relevance: 0
};
const APOS_STRING_MODE = {
scope: 'string',
begin: '\'',
end: '\'',
illegal: '\\n',
contains: [BACKSLASH_ESCAPE]
};
const QUOTE_STRING_MODE = {
scope: 'string',
begin: '"',
end: '"',
illegal: '\\n',
contains: [BACKSLASH_ESCAPE]
};
const PHRASAL_WORDS_MODE = {
begin: /\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/
};
/**
* Creates a comment mode
*
* @param {string | RegExp} begin
* @param {string | RegExp} end
* @param {Mode | {}} [modeOptions]
* @returns {Partial}
*/
const COMMENT = function(begin, end, modeOptions = {}) {
const mode = inherit$1(
{
scope: 'comment',
begin,
end,
contains: []
},
modeOptions
);
mode.contains.push({
scope: 'doctag',
// hack to avoid the space from being included. the space is necessary to
// match here to prevent the plain text rule below from gobbling up doctags
begin: '[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)',
end: /(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,
excludeBegin: true,
relevance: 0
});
const ENGLISH_WORD = either(
// list of common 1 and 2 letter words in English
"I",
"a",
"is",
"so",
"us",
"to",
"at",
"if",
"in",
"it",
"on",
// note: this is not an exhaustive list of contractions, just popular ones
/[A-Za-z]+['](d|ve|re|ll|t|s|n)/, // contractions - can't we'd they're let's, etc
/[A-Za-z]+[-][a-z]+/, // `no-way`, etc.
/[A-Za-z][a-z]{2,}/ // allow capitalized words at beginning of sentences
);
// looking like plain text, more likely to be a comment
mode.contains.push(
{
// TODO: how to include ", (, ) without breaking grammars that use these for
// comment delimiters?
// begin: /[ ]+([()"]?([A-Za-z'-]{3,}|is|a|I|so|us|[tT][oO]|at|if|in|it|on)[.]?[()":]?([.][ ]|[ ]|\))){3}/
// ---
// this tries to find sequences of 3 english words in a row (without any
// "programming" type syntax) this gives us a strong signal that we've
// TRULY found a comment - vs perhaps scanning with the wrong language.
// It's possible to find something that LOOKS like the start of the
// comment - but then if there is no readable text - good chance it is a
// false match and not a comment.
//
// for a visual example please see:
// https://github.com/highlightjs/highlight.js/issues/2827
begin: concat(
/[ ]+/, // necessary to prevent us gobbling up doctags like /* @author Bob Mcgill */
'(',
ENGLISH_WORD,
/[.]?[:]?([.][ ]|[ ])/,
'){3}') // look for 3 words in a row
}
);
return mode;
};
const C_LINE_COMMENT_MODE = COMMENT('//', '$');
const C_BLOCK_COMMENT_MODE = COMMENT('/\\*', '\\*/');
const HASH_COMMENT_MODE = COMMENT('#', '$');
const NUMBER_MODE = {
scope: 'number',
begin: NUMBER_RE,
relevance: 0
};
const C_NUMBER_MODE = {
scope: 'number',
begin: C_NUMBER_RE,
relevance: 0
};
const BINARY_NUMBER_MODE = {
scope: 'number',
begin: BINARY_NUMBER_RE,
relevance: 0
};
const REGEXP_MODE = {
// this outer rule makes sure we actually have a WHOLE regex and not simply
// an expression such as:
//
// 3 / something
//
// (which will then blow up when regex's `illegal` sees the newline)
begin: /(?=\/[^/\n]*\/)/,
contains: [{
scope: 'regexp',
begin: /\//,
end: /\/[gimuy]*/,
illegal: /\n/,
contains: [
BACKSLASH_ESCAPE,
{
begin: /\[/,
end: /\]/,
relevance: 0,
contains: [BACKSLASH_ESCAPE]
}
]
}]
};
const TITLE_MODE = {
scope: 'title',
begin: IDENT_RE,
relevance: 0
};
const UNDERSCORE_TITLE_MODE = {
scope: 'title',
begin: UNDERSCORE_IDENT_RE,
relevance: 0
};
const METHOD_GUARD = {
// excludes method names from keyword processing
begin: '\\.\\s*' + UNDERSCORE_IDENT_RE,
relevance: 0
};
/**
* Adds end same as begin mechanics to a mode
*
* Your mode must include at least a single () match group as that first match
* group is what is used for comparison
* @param {Partial} mode
*/
const END_SAME_AS_BEGIN = function(mode) {
return Object.assign(mode,
{
/** @type {ModeCallback} */
'on:begin': (m, resp) => { resp.data._beginMatch = m[1]; },
/** @type {ModeCallback} */
'on:end': (m, resp) => { if (resp.data._beginMatch !== m[1]) resp.ignoreMatch(); }
});
};
var MODES = /*#__PURE__*/Object.freeze({
__proto__: null,
MATCH_NOTHING_RE: MATCH_NOTHING_RE,
IDENT_RE: IDENT_RE,
UNDERSCORE_IDENT_RE: UNDERSCORE_IDENT_RE,
NUMBER_RE: NUMBER_RE,
C_NUMBER_RE: C_NUMBER_RE,
BINARY_NUMBER_RE: BINARY_NUMBER_RE,
RE_STARTERS_RE: RE_STARTERS_RE,
SHEBANG: SHEBANG,
BACKSLASH_ESCAPE: BACKSLASH_ESCAPE,
APOS_STRING_MODE: APOS_STRING_MODE,
QUOTE_STRING_MODE: QUOTE_STRING_MODE,
PHRASAL_WORDS_MODE: PHRASAL_WORDS_MODE,
COMMENT: COMMENT,
C_LINE_COMMENT_MODE: C_LINE_COMMENT_MODE,
C_BLOCK_COMMENT_MODE: C_BLOCK_COMMENT_MODE,
HASH_COMMENT_MODE: HASH_COMMENT_MODE,
NUMBER_MODE: NUMBER_MODE,
C_NUMBER_MODE: C_NUMBER_MODE,
BINARY_NUMBER_MODE: BINARY_NUMBER_MODE,
REGEXP_MODE: REGEXP_MODE,
TITLE_MODE: TITLE_MODE,
UNDERSCORE_TITLE_MODE: UNDERSCORE_TITLE_MODE,
METHOD_GUARD: METHOD_GUARD,
END_SAME_AS_BEGIN: END_SAME_AS_BEGIN
});
/**
@typedef {import('highlight.js').CallbackResponse} CallbackResponse
@typedef {import('highlight.js').CompilerExt} CompilerExt
*/
// Grammar extensions / plugins
// See: https://github.com/highlightjs/highlight.js/issues/2833
// Grammar extensions allow "syntactic sugar" to be added to the grammar modes
// without requiring any underlying changes to the compiler internals.
// `compileMatch` being the perfect small example of now allowing a grammar
// author to write `match` when they desire to match a single expression rather
// than being forced to use `begin`. The extension then just moves `match` into
// `begin` when it runs. Ie, no features have been added, but we've just made
// the experience of writing (and reading grammars) a little bit nicer.
// ------
// TODO: We need negative look-behind support to do this properly
/**
* Skip a match if it has a preceding dot
*
* This is used for `beginKeywords` to prevent matching expressions such as
* `bob.keyword.do()`. The mode compiler automatically wires this up as a
* special _internal_ 'on:begin' callback for modes with `beginKeywords`
* @param {RegExpMatchArray} match
* @param {CallbackResponse} response
*/
function skipIfHasPrecedingDot(match, response) {
const before = match.input[match.index - 1];
if (before === ".") {
response.ignoreMatch();
}
}
/**
*
* @type {CompilerExt}
*/
function scopeClassName(mode, _parent) {
// eslint-disable-next-line no-undefined
if (mode.className !== undefined) {
mode.scope = mode.className;
delete mode.className;
}
}
/**
* `beginKeywords` syntactic sugar
* @type {CompilerExt}
*/
function beginKeywords(mode, parent) {
if (!parent) return;
if (!mode.beginKeywords) return;
// for languages with keywords that include non-word characters checking for
// a word boundary is not sufficient, so instead we check for a word boundary
// or whitespace - this does no harm in any case since our keyword engine
// doesn't allow spaces in keywords anyways and we still check for the boundary
// first
mode.begin = '\\b(' + mode.beginKeywords.split(' ').join('|') + ')(?!\\.)(?=\\b|\\s)';
mode.__beforeBegin = skipIfHasPrecedingDot;
mode.keywords = mode.keywords || mode.beginKeywords;
delete mode.beginKeywords;
// prevents double relevance, the keywords themselves provide
// relevance, the mode doesn't need to double it
// eslint-disable-next-line no-undefined
if (mode.relevance === undefined) mode.relevance = 0;
}
/**
* Allow `illegal` to contain an array of illegal values
* @type {CompilerExt}
*/
function compileIllegal(mode, _parent) {
if (!Array.isArray(mode.illegal)) return;
mode.illegal = either(...mode.illegal);
}
/**
* `match` to match a single expression for readability
* @type {CompilerExt}
*/
function compileMatch(mode, _parent) {
if (!mode.match) return;
if (mode.begin || mode.end) throw new Error("begin & end are not supported with match");
mode.begin = mode.match;
delete mode.match;
}
/**
* provides the default 1 relevance to all modes
* @type {CompilerExt}
*/
function compileRelevance(mode, _parent) {
// eslint-disable-next-line no-undefined
if (mode.relevance === undefined) mode.relevance = 1;
}
// allow beforeMatch to act as a "qualifier" for the match
// the full match begin must be [beforeMatch][begin]
const beforeMatchExt = (mode, parent) => {
if (!mode.beforeMatch) return;
// starts conflicts with endsParent which we need to make sure the child
// rule is not matched multiple times
if (mode.starts) throw new Error("beforeMatch cannot be used with starts");
const originalMode = Object.assign({}, mode);
Object.keys(mode).forEach((key) => { delete mode[key]; });
mode.keywords = originalMode.keywords;
mode.begin = concat(originalMode.beforeMatch, lookahead(originalMode.begin));
mode.starts = {
relevance: 0,
contains: [
Object.assign(originalMode, { endsParent: true })
]
};
mode.relevance = 0;
delete originalMode.beforeMatch;
};
// keywords that should have no default relevance value
const COMMON_KEYWORDS = [
'of',
'and',
'for',
'in',
'not',
'or',
'if',
'then',
'parent', // common variable name
'list', // common variable name
'value' // common variable name
];
const DEFAULT_KEYWORD_SCOPE = "keyword";
/**
* Given raw keywords from a language definition, compile them.
*
* @param {string | Record | Array} rawKeywords
* @param {boolean} caseInsensitive
*/
function compileKeywords(rawKeywords, caseInsensitive, scopeName = DEFAULT_KEYWORD_SCOPE) {
/** @type KeywordDict */
const compiledKeywords = Object.create(null);
// input can be a string of keywords, an array of keywords, or a object with
// named keys representing scopeName (which can then point to a string or array)
if (typeof rawKeywords === 'string') {
compileList(scopeName, rawKeywords.split(" "));
} else if (Array.isArray(rawKeywords)) {
compileList(scopeName, rawKeywords);
} else {
Object.keys(rawKeywords).forEach(function(scopeName) {
// collapse all our objects back into the parent object
Object.assign(
compiledKeywords,
compileKeywords(rawKeywords[scopeName], caseInsensitive, scopeName)
);
});
}
return compiledKeywords;
// ---
/**
* Compiles an individual list of keywords
*
* Ex: "for if when while|5"
*
* @param {string} scopeName
* @param {Array} keywordList
*/
function compileList(scopeName, keywordList) {
if (caseInsensitive) {
keywordList = keywordList.map(x => x.toLowerCase());
}
keywordList.forEach(function(keyword) {
const pair = keyword.split('|');
compiledKeywords[pair[0]] = [scopeName, scoreForKeyword(pair[0], pair[1])];
});
}
}
/**
* Returns the proper score for a given keyword
*
* Also takes into account comment keywords, which will be scored 0 UNLESS
* another score has been manually assigned.
* @param {string} keyword
* @param {string} [providedScore]
*/
function scoreForKeyword(keyword, providedScore) {
// manual scores always win over common keywords
// so you can force a score of 1 if you really insist
if (providedScore) {
return Number(providedScore);
}
return commonKeyword(keyword) ? 0 : 1;
}
/**
* Determines if a given keyword is common or not
*
* @param {string} keyword */
function commonKeyword(keyword) {
return COMMON_KEYWORDS.includes(keyword.toLowerCase());
}
/*
For the reasoning behind this please see:
https://github.com/highlightjs/highlight.js/issues/2880#issuecomment-747275419
*/
/**
* @type {Record}
*/
const seenDeprecations = {};
/**
* @param {string} message
*/
const error = (message) => {
console.error(message);
};
/**
* @param {string} message
* @param {any} args
*/
const warn = (message, ...args) => {
console.log(`WARN: ${message}`, ...args);
};
/**
* @param {string} version
* @param {string} message
*/
const deprecated = (version, message) => {
if (seenDeprecations[`${version}/${message}`]) return;
console.log(`Deprecated as of ${version}. ${message}`);
seenDeprecations[`${version}/${message}`] = true;
};
/* eslint-disable no-throw-literal */
/**
@typedef {import('highlight.js').CompiledMode} CompiledMode
*/
const MultiClassError = new Error();
/**
* Renumbers labeled scope names to account for additional inner match
* groups that otherwise would break everything.
*
* Lets say we 3 match scopes:
*
* { 1 => ..., 2 => ..., 3 => ... }
*
* So what we need is a clean match like this:
*
* (a)(b)(c) => [ "a", "b", "c" ]
*
* But this falls apart with inner match groups:
*
* (a)(((b)))(c) => ["a", "b", "b", "b", "c" ]
*
* Our scopes are now "out of alignment" and we're repeating `b` 3 times.
* What needs to happen is the numbers are remapped:
*
* { 1 => ..., 2 => ..., 5 => ... }
*
* We also need to know that the ONLY groups that should be output
* are 1, 2, and 5. This function handles this behavior.
*
* @param {CompiledMode} mode
* @param {Array} regexes
* @param {{key: "beginScope"|"endScope"}} opts
*/
function remapScopeNames(mode, regexes, { key }) {
let offset = 0;
const scopeNames = mode[key];
/** @type Record */
const emit = {};
/** @type Record */
const positions = {};
for (let i = 1; i <= regexes.length; i++) {
positions[i + offset] = scopeNames[i];
emit[i + offset] = true;
offset += countMatchGroups(regexes[i - 1]);
}
// we use _emit to keep track of which match groups are "top-level" to avoid double
// output from inside match groups
mode[key] = positions;
mode[key]._emit = emit;
mode[key]._multi = true;
}
/**
* @param {CompiledMode} mode
*/
function beginMultiClass(mode) {
if (!Array.isArray(mode.begin)) return;
if (mode.skip || mode.excludeBegin || mode.returnBegin) {
error("skip, excludeBegin, returnBegin not compatible with beginScope: {}");
throw MultiClassError;
}
if (typeof mode.beginScope !== "object" || mode.beginScope === null) {
error("beginScope must be object");
throw MultiClassError;
}
remapScopeNames(mode, mode.begin, { key: "beginScope" });
mode.begin = _rewriteBackreferences(mode.begin, { joinWith: "" });
}
/**
* @param {CompiledMode} mode
*/
function endMultiClass(mode) {
if (!Array.isArray(mode.end)) return;
if (mode.skip || mode.excludeEnd || mode.returnEnd) {
error("skip, excludeEnd, returnEnd not compatible with endScope: {}");
throw MultiClassError;
}
if (typeof mode.endScope !== "object" || mode.endScope === null) {
error("endScope must be object");
throw MultiClassError;
}
remapScopeNames(mode, mode.end, { key: "endScope" });
mode.end = _rewriteBackreferences(mode.end, { joinWith: "" });
}
/**
* this exists only to allow `scope: {}` to be used beside `match:`
* Otherwise `beginScope` would necessary and that would look weird
{
match: [ /def/, /\w+/ ]
scope: { 1: "keyword" , 2: "title" }
}
* @param {CompiledMode} mode
*/
function scopeSugar(mode) {
if (mode.scope && typeof mode.scope === "object" && mode.scope !== null) {
mode.beginScope = mode.scope;
delete mode.scope;
}
}
/**
* @param {CompiledMode} mode
*/
function MultiClass(mode) {
scopeSugar(mode);
if (typeof mode.beginScope === "string") {
mode.beginScope = { _wrap: mode.beginScope };
}
if (typeof mode.endScope === "string") {
mode.endScope = { _wrap: mode.endScope };
}
beginMultiClass(mode);
endMultiClass(mode);
}
/**
@typedef {import('highlight.js').Mode} Mode
@typedef {import('highlight.js').CompiledMode} CompiledMode
@typedef {import('highlight.js').Language} Language
@typedef {import('highlight.js').HLJSPlugin} HLJSPlugin
@typedef {import('highlight.js').CompiledLanguage} CompiledLanguage
*/
// compilation
/**
* Compiles a language definition result
*
* Given the raw result of a language definition (Language), compiles this so
* that it is ready for highlighting code.
* @param {Language} language
* @returns {CompiledLanguage}
*/
function compileLanguage(language) {
/**
* Builds a regex with the case sensitivity of the current language
*
* @param {RegExp | string} value
* @param {boolean} [global]
*/
function langRe(value, global) {
return new RegExp(
source(value),
'm'
+ (language.case_insensitive ? 'i' : '')
+ (language.unicodeRegex ? 'u' : '')
+ (global ? 'g' : '')
);
}
/**
Stores multiple regular expressions and allows you to quickly search for
them all in a string simultaneously - returning the first match. It does
this by creating a huge (a|b|c) regex - each individual item wrapped with ()
and joined by `|` - using match groups to track position. When a match is
found checking which position in the array has content allows us to figure
out which of the original regexes / match groups triggered the match.
The match object itself (the result of `Regex.exec`) is returned but also
enhanced by merging in any meta-data that was registered with the regex.
This is how we keep track of which mode matched, and what type of rule
(`illegal`, `begin`, end, etc).
*/
class MultiRegex {
constructor() {
this.matchIndexes = {};
// @ts-ignore
this.regexes = [];
this.matchAt = 1;
this.position = 0;
}
// @ts-ignore
addRule(re, opts) {
opts.position = this.position++;
// @ts-ignore
this.matchIndexes[this.matchAt] = opts;
this.regexes.push([opts, re]);
this.matchAt += countMatchGroups(re) + 1;
}
compile() {
if (this.regexes.length === 0) {
// avoids the need to check length every time exec is called
// @ts-ignore
this.exec = () => null;
}
const terminators = this.regexes.map(el => el[1]);
this.matcherRe = langRe(_rewriteBackreferences(terminators, { joinWith: '|' }), true);
this.lastIndex = 0;
}
/** @param {string} s */
exec(s) {
this.matcherRe.lastIndex = this.lastIndex;
const match = this.matcherRe.exec(s);
if (!match) { return null; }
// eslint-disable-next-line no-undefined
const i = match.findIndex((el, i) => i > 0 && el !== undefined);
// @ts-ignore
const matchData = this.matchIndexes[i];
// trim off any earlier non-relevant match groups (ie, the other regex
// match groups that make up the multi-matcher)
match.splice(0, i);
return Object.assign(match, matchData);
}
}
/*
Created to solve the key deficiently with MultiRegex - there is no way to
test for multiple matches at a single location. Why would we need to do
that? In the future a more dynamic engine will allow certain matches to be
ignored. An example: if we matched say the 3rd regex in a large group but
decided to ignore it - we'd need to started testing again at the 4th
regex... but MultiRegex itself gives us no real way to do that.
So what this class creates MultiRegexs on the fly for whatever search
position they are needed.
NOTE: These additional MultiRegex objects are created dynamically. For most
grammars most of the time we will never actually need anything more than the
first MultiRegex - so this shouldn't have too much overhead.
Say this is our search group, and we match regex3, but wish to ignore it.
regex1 | regex2 | regex3 | regex4 | regex5 ' ie, startAt = 0
What we need is a new MultiRegex that only includes the remaining
possibilities:
regex4 | regex5 ' ie, startAt = 3
This class wraps all that complexity up in a simple API... `startAt` decides
where in the array of expressions to start doing the matching. It
auto-increments, so if a match is found at position 2, then startAt will be
set to 3. If the end is reached startAt will return to 0.
MOST of the time the parser will be setting startAt manually to 0.
*/
class ResumableMultiRegex {
constructor() {
// @ts-ignore
this.rules = [];
// @ts-ignore
this.multiRegexes = [];
this.count = 0;
this.lastIndex = 0;
this.regexIndex = 0;
}
// @ts-ignore
getMatcher(index) {
if (this.multiRegexes[index]) return this.multiRegexes[index];
const matcher = new MultiRegex();
this.rules.slice(index).forEach(([re, opts]) => matcher.addRule(re, opts));
matcher.compile();
this.multiRegexes[index] = matcher;
return matcher;
}
resumingScanAtSamePosition() {
return this.regexIndex !== 0;
}
considerAll() {
this.regexIndex = 0;
}
// @ts-ignore
addRule(re, opts) {
this.rules.push([re, opts]);
if (opts.type === "begin") this.count++;
}
/** @param {string} s */
exec(s) {
const m = this.getMatcher(this.regexIndex);
m.lastIndex = this.lastIndex;
let result = m.exec(s);
// The following is because we have no easy way to say "resume scanning at the
// existing position but also skip the current rule ONLY". What happens is
// all prior rules are also skipped which can result in matching the wrong
// thing. Example of matching "booger":
// our matcher is [string, "booger", number]
//
// ....booger....
// if "booger" is ignored then we'd really need a regex to scan from the
// SAME position for only: [string, number] but ignoring "booger" (if it
// was the first match), a simple resume would scan ahead who knows how
// far looking only for "number", ignoring potential string matches (or
// future "booger" matches that might be valid.)
// So what we do: We execute two matchers, one resuming at the same
// position, but the second full matcher starting at the position after:
// /--- resume first regex match here (for [number])
// |/---- full match here for [string, "booger", number]
// vv
// ....booger....
// Which ever results in a match first is then used. So this 3-4 step
// process essentially allows us to say "match at this position, excluding
// a prior rule that was ignored".
//
// 1. Match "booger" first, ignore. Also proves that [string] does non match.
// 2. Resume matching for [number]
// 3. Match at index + 1 for [string, "booger", number]
// 4. If #2 and #3 result in matches, which came first?
if (this.resumingScanAtSamePosition()) {
if (result && result.index === this.lastIndex) ; else { // use the second matcher result
const m2 = this.getMatcher(0);
m2.lastIndex = this.lastIndex + 1;
result = m2.exec(s);
}
}
if (result) {
this.regexIndex += result.position + 1;
if (this.regexIndex === this.count) {
// wrap-around to considering all matches again
this.considerAll();
}
}
return result;
}
}
/**
* Given a mode, builds a huge ResumableMultiRegex that can be used to walk
* the content and find matches.
*
* @param {CompiledMode} mode
* @returns {ResumableMultiRegex}
*/
function buildModeRegex(mode) {
const mm = new ResumableMultiRegex();
mode.contains.forEach(term => mm.addRule(term.begin, { rule: term, type: "begin" }));
if (mode.terminatorEnd) {
mm.addRule(mode.terminatorEnd, { type: "end" });
}
if (mode.illegal) {
mm.addRule(mode.illegal, { type: "illegal" });
}
return mm;
}
/** skip vs abort vs ignore
*
* @skip - The mode is still entered and exited normally (and contains rules apply),
* but all content is held and added to the parent buffer rather than being
* output when the mode ends. Mostly used with `sublanguage` to build up
* a single large buffer than can be parsed by sublanguage.
*
* - The mode begin ands ends normally.
* - Content matched is added to the parent mode buffer.
* - The parser cursor is moved forward normally.
*
* @abort - A hack placeholder until we have ignore. Aborts the mode (as if it
* never matched) but DOES NOT continue to match subsequent `contains`
* modes. Abort is bad/suboptimal because it can result in modes
* farther down not getting applied because an earlier rule eats the
* content but then aborts.
*
* - The mode does not begin.
* - Content matched by `begin` is added to the mode buffer.
* - The parser cursor is moved forward accordingly.
*
* @ignore - Ignores the mode (as if it never matched) and continues to match any
* subsequent `contains` modes. Ignore isn't technically possible with
* the current parser implementation.
*
* - The mode does not begin.
* - Content matched by `begin` is ignored.
* - The parser cursor is not moved forward.
*/
/**
* Compiles an individual mode
*
* This can raise an error if the mode contains certain detectable known logic
* issues.
* @param {Mode} mode
* @param {CompiledMode | null} [parent]
* @returns {CompiledMode | never}
*/
function compileMode(mode, parent) {
const cmode = /** @type CompiledMode */ (mode);
if (mode.isCompiled) return cmode;
[
scopeClassName,
// do this early so compiler extensions generally don't have to worry about
// the distinction between match/begin
compileMatch,
MultiClass,
beforeMatchExt
].forEach(ext => ext(mode, parent));
language.compilerExtensions.forEach(ext => ext(mode, parent));
// __beforeBegin is considered private API, internal use only
mode.__beforeBegin = null;
[
beginKeywords,
// do this later so compiler extensions that come earlier have access to the
// raw array if they wanted to perhaps manipulate it, etc.
compileIllegal,
// default to 1 relevance if not specified
compileRelevance
].forEach(ext => ext(mode, parent));
mode.isCompiled = true;
let keywordPattern = null;
if (typeof mode.keywords === "object" && mode.keywords.$pattern) {
// we need a copy because keywords might be compiled multiple times
// so we can't go deleting $pattern from the original on the first
// pass
mode.keywords = Object.assign({}, mode.keywords);
keywordPattern = mode.keywords.$pattern;
delete mode.keywords.$pattern;
}
keywordPattern = keywordPattern || /\w+/;
if (mode.keywords) {
mode.keywords = compileKeywords(mode.keywords, language.case_insensitive);
}
cmode.keywordPatternRe = langRe(keywordPattern, true);
if (parent) {
if (!mode.begin) mode.begin = /\B|\b/;
cmode.beginRe = langRe(cmode.begin);
if (!mode.end && !mode.endsWithParent) mode.end = /\B|\b/;
if (mode.end) cmode.endRe = langRe(cmode.end);
cmode.terminatorEnd = source(cmode.end) || '';
if (mode.endsWithParent && parent.terminatorEnd) {
cmode.terminatorEnd += (mode.end ? '|' : '') + parent.terminatorEnd;
}
}
if (mode.illegal) cmode.illegalRe = langRe(/** @type {RegExp | string} */ (mode.illegal));
if (!mode.contains) mode.contains = [];
mode.contains = [].concat(...mode.contains.map(function(c) {
return expandOrCloneMode(c === 'self' ? mode : c);
}));
mode.contains.forEach(function(c) { compileMode(/** @type Mode */ (c), cmode); });
if (mode.starts) {
compileMode(mode.starts, parent);
}
cmode.matcher = buildModeRegex(cmode);
return cmode;
}
if (!language.compilerExtensions) language.compilerExtensions = [];
// self is not valid at the top-level
if (language.contains && language.contains.includes('self')) {
throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");
}
// we need a null object, which inherit will guarantee
language.classNameAliases = inherit$1(language.classNameAliases || {});
return compileMode(/** @type Mode */ (language));
}
/**
* Determines if a mode has a dependency on it's parent or not
*
* If a mode does have a parent dependency then often we need to clone it if
* it's used in multiple places so that each copy points to the correct parent,
* where-as modes without a parent can often safely be re-used at the bottom of
* a mode chain.
*
* @param {Mode | null} mode
* @returns {boolean} - is there a dependency on the parent?
* */
function dependencyOnParent(mode) {
if (!mode) return false;
return mode.endsWithParent || dependencyOnParent(mode.starts);
}
/**
* Expands a mode or clones it if necessary
*
* This is necessary for modes with parental dependenceis (see notes on
* `dependencyOnParent`) and for nodes that have `variants` - which must then be
* exploded into their own individual modes at compile time.
*
* @param {Mode} mode
* @returns {Mode | Mode[]}
* */
function expandOrCloneMode(mode) {
if (mode.variants && !mode.cachedVariants) {
mode.cachedVariants = mode.variants.map(function(variant) {
return inherit$1(mode, { variants: null }, variant);
});
}
// EXPAND
// if we have variants then essentially "replace" the mode with the variants
// this happens in compileMode, where this function is called from
if (mode.cachedVariants) {
return mode.cachedVariants;
}
// CLONE
// if we have dependencies on parents then we need a unique
// instance of ourselves, so we can be reused with many
// different parents without issue
if (dependencyOnParent(mode)) {
return inherit$1(mode, { starts: mode.starts ? inherit$1(mode.starts) : null });
}
if (Object.isFrozen(mode)) {
return inherit$1(mode);
}
// no special dependency issues, just return ourselves
return mode;
}
var version = "11.3.1";
class HTMLInjectionError extends Error {
constructor(reason, html) {
super(reason);
this.name = "HTMLInjectionError";
this.html = html;
}
}
/*
Syntax highlighting with language autodetection.
https://highlightjs.org/
*/
/**
@typedef {import('highlight.js').Mode} Mode
@typedef {import('highlight.js').CompiledMode} CompiledMode
@typedef {import('highlight.js').CompiledScope} CompiledScope
@typedef {import('highlight.js').Language} Language
@typedef {import('highlight.js').HLJSApi} HLJSApi
@typedef {import('highlight.js').HLJSPlugin} HLJSPlugin
@typedef {import('highlight.js').PluginEvent} PluginEvent
@typedef {import('highlight.js').HLJSOptions} HLJSOptions
@typedef {import('highlight.js').LanguageFn} LanguageFn
@typedef {import('highlight.js').HighlightedHTMLElement} HighlightedHTMLElement
@typedef {import('highlight.js').BeforeHighlightContext} BeforeHighlightContext
@typedef {import('highlight.js/private').MatchType} MatchType
@typedef {import('highlight.js/private').KeywordData} KeywordData
@typedef {import('highlight.js/private').EnhancedMatch} EnhancedMatch
@typedef {import('highlight.js/private').AnnotatedError} AnnotatedError
@typedef {import('highlight.js').AutoHighlightResult} AutoHighlightResult
@typedef {import('highlight.js').HighlightOptions} HighlightOptions
@typedef {import('highlight.js').HighlightResult} HighlightResult
*/
const escape = escapeHTML;
const inherit = inherit$1;
const NO_MATCH = Symbol("nomatch");
const MAX_KEYWORD_HITS = 7;
/**
* @param {any} hljs - object that is extended (legacy)
* @returns {HLJSApi}
*/
const HLJS = function(hljs) {
// Global internal variables used within the highlight.js library.
/** @type {Record} */
const languages = Object.create(null);
/** @type {Record} */
const aliases = Object.create(null);
/** @type {HLJSPlugin[]} */
const plugins = [];
// safe/production mode - swallows more errors, tries to keep running
// even if a single syntax or parse hits a fatal error
let SAFE_MODE = true;
const LANGUAGE_NOT_FOUND = "Could not find the language '{}', did you forget to load/include a language module?";
/** @type {Language} */
const PLAINTEXT_LANGUAGE = { disableAutodetect: true, name: 'Plain text', contains: [] };
// Global options used when within external APIs. This is modified when
// calling the `hljs.configure` function.
/** @type HLJSOptions */
let options = {
ignoreUnescapedHTML: false,
throwUnescapedHTML: false,
noHighlightRe: /^(no-?highlight)$/i,
languageDetectRe: /\blang(?:uage)?-([\w-]+)\b/i,
classPrefix: 'hljs-',
cssSelector: 'pre code',
languages: null,
// beta configuration options, subject to change, welcome to discuss
// https://github.com/highlightjs/highlight.js/issues/1086
__emitter: TokenTreeEmitter
};
/* Utility functions */
/**
* Tests a language name to see if highlighting should be skipped
* @param {string} languageName
*/
function shouldNotHighlight(languageName) {
return options.noHighlightRe.test(languageName);
}
/**
* @param {HighlightedHTMLElement} block - the HTML element to determine language for
*/
function blockLanguage(block) {
let classes = block.className + ' ';
classes += block.parentNode ? block.parentNode.className : '';
// language-* takes precedence over non-prefixed class names.
const match = options.languageDetectRe.exec(classes);
if (match) {
const language = getLanguage(match[1]);
if (!language) {
warn(LANGUAGE_NOT_FOUND.replace("{}", match[1]));
warn("Falling back to no-highlight mode for this block.", block);
}
return language ? match[1] : 'no-highlight';
}
return classes
.split(/\s+/)
.find((_class) => shouldNotHighlight(_class) || getLanguage(_class));
}
/**
* Core highlighting function.
*
* OLD API
* highlight(lang, code, ignoreIllegals, continuation)
*
* NEW API
* highlight(code, {lang, ignoreIllegals})
*
* @param {string} codeOrLanguageName - the language to use for highlighting
* @param {string | HighlightOptions} optionsOrCode - the code to highlight
* @param {boolean} [ignoreIllegals] - whether to ignore illegal matches, default is to bail
*
* @returns {HighlightResult} Result - an object that represents the result
* @property {string} language - the language name
* @property {number} relevance - the relevance score
* @property {string} value - the highlighted HTML code
* @property {string} code - the original raw code
* @property {CompiledMode} top - top of the current mode stack
* @property {boolean} illegal - indicates whether any illegal matches were found
*/
function highlight(codeOrLanguageName, optionsOrCode, ignoreIllegals) {
let code = "";
let languageName = "";
if (typeof optionsOrCode === "object") {
code = codeOrLanguageName;
ignoreIllegals = optionsOrCode.ignoreIllegals;
languageName = optionsOrCode.language;
} else {
// old API
deprecated("10.7.0", "highlight(lang, code, ...args) has been deprecated.");
deprecated("10.7.0", "Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277");
languageName = codeOrLanguageName;
code = optionsOrCode;
}
// https://github.com/highlightjs/highlight.js/issues/3149
// eslint-disable-next-line no-undefined
if (ignoreIllegals === undefined) { ignoreIllegals = true; }
/** @type {BeforeHighlightContext} */
const context = {
code,
language: languageName
};
// the plugin can change the desired language or the code to be highlighted
// just be changing the object it was passed
fire("before:highlight", context);
// a before plugin can usurp the result completely by providing it's own
// in which case we don't even need to call highlight
const result = context.result
? context.result
: _highlight(context.language, context.code, ignoreIllegals);
result.code = context.code;
// the plugin can change anything in result to suite it
fire("after:highlight", result);
return result;
}
/**
* private highlight that's used internally and does not fire callbacks
*
* @param {string} languageName - the language to use for highlighting
* @param {string} codeToHighlight - the code to highlight
* @param {boolean?} [ignoreIllegals] - whether to ignore illegal matches, default is to bail
* @param {CompiledMode?} [continuation] - current continuation mode, if any
* @returns {HighlightResult} - result of the highlight operation
*/
function _highlight(languageName, codeToHighlight, ignoreIllegals, continuation) {
const keywordHits = Object.create(null);
/**
* Return keyword data if a match is a keyword
* @param {CompiledMode} mode - current mode
* @param {string} matchText - the textual match
* @returns {KeywordData | false}
*/
function keywordData(mode, matchText) {
return mode.keywords[matchText];
}
function processKeywords() {
if (!top.keywords) {
emitter.addText(modeBuffer);
return;
}
let lastIndex = 0;
top.keywordPatternRe.lastIndex = 0;
let match = top.keywordPatternRe.exec(modeBuffer);
let buf = "";
while (match) {
buf += modeBuffer.substring(lastIndex, match.index);
const word = language.case_insensitive ? match[0].toLowerCase() : match[0];
const data = keywordData(top, word);
if (data) {
const [kind, keywordRelevance] = data;
emitter.addText(buf);
buf = "";
keywordHits[word] = (keywordHits[word] || 0) + 1;
if (keywordHits[word] <= MAX_KEYWORD_HITS) relevance += keywordRelevance;
if (kind.startsWith("_")) {
// _ implied for relevance only, do not highlight
// by applying a class name
buf += match[0];
} else {
const cssClass = language.classNameAliases[kind] || kind;
emitter.addKeyword(match[0], cssClass);
}
} else {
buf += match[0];
}
lastIndex = top.keywordPatternRe.lastIndex;
match = top.keywordPatternRe.exec(modeBuffer);
}
buf += modeBuffer.substr(lastIndex);
emitter.addText(buf);
}
function processSubLanguage() {
if (modeBuffer === "") return;
/** @type HighlightResult */
let result = null;
if (typeof top.subLanguage === 'string') {
if (!languages[top.subLanguage]) {
emitter.addText(modeBuffer);
return;
}
result = _highlight(top.subLanguage, modeBuffer, true, continuations[top.subLanguage]);
continuations[top.subLanguage] = /** @type {CompiledMode} */ (result._top);
} else {
result = highlightAuto(modeBuffer, top.subLanguage.length ? top.subLanguage : null);
}
// Counting embedded language score towards the host language may be disabled
// with zeroing the containing mode relevance. Use case in point is Markdown that
// allows XML everywhere and makes every XML snippet to have a much larger Markdown
// score.
if (top.relevance > 0) {
relevance += result.relevance;
}
emitter.addSublanguage(result._emitter, result.language);
}
function processBuffer() {
if (top.subLanguage != null) {
processSubLanguage();
} else {
processKeywords();
}
modeBuffer = '';
}
/**
* @param {CompiledScope} scope
* @param {RegExpMatchArray} match
*/
function emitMultiClass(scope, match) {
let i = 1;
// eslint-disable-next-line no-undefined
while (match[i] !== undefined) {
if (!scope._emit[i]) { i++; continue; }
const klass = language.classNameAliases[scope[i]] || scope[i];
const text = match[i];
if (klass) {
emitter.addKeyword(text, klass);
} else {
modeBuffer = text;
processKeywords();
modeBuffer = "";
}
i++;
}
}
/**
* @param {CompiledMode} mode - new mode to start
* @param {RegExpMatchArray} match
*/
function startNewMode(mode, match) {
if (mode.scope && typeof mode.scope === "string") {
emitter.openNode(language.classNameAliases[mode.scope] || mode.scope);
}
if (mode.beginScope) {
// beginScope just wraps the begin match itself in a scope
if (mode.beginScope._wrap) {
emitter.addKeyword(modeBuffer, language.classNameAliases[mode.beginScope._wrap] || mode.beginScope._wrap);
modeBuffer = "";
} else if (mode.beginScope._multi) {
// at this point modeBuffer should just be the match
emitMultiClass(mode.beginScope, match);
modeBuffer = "";
}
}
top = Object.create(mode, { parent: { value: top } });
return top;
}
/**
* @param {CompiledMode } mode - the mode to potentially end
* @param {RegExpMatchArray} match - the latest match
* @param {string} matchPlusRemainder - match plus remainder of content
* @returns {CompiledMode | void} - the next mode, or if void continue on in current mode
*/
function endOfMode(mode, match, matchPlusRemainder) {
let matched = startsWith(mode.endRe, matchPlusRemainder);
if (matched) {
if (mode["on:end"]) {
const resp = new Response(mode);
mode["on:end"](match, resp);
if (resp.isMatchIgnored) matched = false;
}
if (matched) {
while (mode.endsParent && mode.parent) {
mode = mode.parent;
}
return mode;
}
}
// even if on:end fires an `ignore` it's still possible
// that we might trigger the end node because of a parent mode
if (mode.endsWithParent) {
return endOfMode(mode.parent, match, matchPlusRemainder);
}
}
/**
* Handle matching but then ignoring a sequence of text
*
* @param {string} lexeme - string containing full match text
*/
function doIgnore(lexeme) {
if (top.matcher.regexIndex === 0) {
// no more regexes to potentially match here, so we move the cursor forward one
// space
modeBuffer += lexeme[0];
return 1;
} else {
// no need to move the cursor, we still have additional regexes to try and
// match at this very spot
resumeScanAtSamePosition = true;
return 0;
}
}
/**
* Handle the start of a new potential mode match
*
* @param {EnhancedMatch} match - the current match
* @returns {number} how far to advance the parse cursor
*/
function doBeginMatch(match) {
const lexeme = match[0];
const newMode = match.rule;
const resp = new Response(newMode);
// first internal before callbacks, then the public ones
const beforeCallbacks = [newMode.__beforeBegin, newMode["on:begin"]];
for (const cb of beforeCallbacks) {
if (!cb) continue;
cb(match, resp);
if (resp.isMatchIgnored) return doIgnore(lexeme);
}
if (newMode.skip) {
modeBuffer += lexeme;
} else {
if (newMode.excludeBegin) {
modeBuffer += lexeme;
}
processBuffer();
if (!newMode.returnBegin && !newMode.excludeBegin) {
modeBuffer = lexeme;
}
}
startNewMode(newMode, match);
return newMode.returnBegin ? 0 : lexeme.length;
}
/**
* Handle the potential end of mode
*
* @param {RegExpMatchArray} match - the current match
*/
function doEndMatch(match) {
const lexeme = match[0];
const matchPlusRemainder = codeToHighlight.substr(match.index);
const endMode = endOfMode(top, match, matchPlusRemainder);
if (!endMode) { return NO_MATCH; }
const origin = top;
if (top.endScope && top.endScope._wrap) {
processBuffer();
emitter.addKeyword(lexeme, top.endScope._wrap);
} else if (top.endScope && top.endScope._multi) {
processBuffer();
emitMultiClass(top.endScope, match);
} else if (origin.skip) {
modeBuffer += lexeme;
} else {
if (!(origin.returnEnd || origin.excludeEnd)) {
modeBuffer += lexeme;
}
processBuffer();
if (origin.excludeEnd) {
modeBuffer = lexeme;
}
}
do {
if (top.scope) {
emitter.closeNode();
}
if (!top.skip && !top.subLanguage) {
relevance += top.relevance;
}
top = top.parent;
} while (top !== endMode.parent);
if (endMode.starts) {
startNewMode(endMode.starts, match);
}
return origin.returnEnd ? 0 : lexeme.length;
}
function processContinuations() {
const list = [];
for (let current = top; current !== language; current = current.parent) {
if (current.scope) {
list.unshift(current.scope);
}
}
list.forEach(item => emitter.openNode(item));
}
/** @type {{type?: MatchType, index?: number, rule?: Mode}}} */
let lastMatch = {};
/**
* Process an individual match
*
* @param {string} textBeforeMatch - text preceding the match (since the last match)
* @param {EnhancedMatch} [match] - the match itself
*/
function processLexeme(textBeforeMatch, match) {
const lexeme = match && match[0];
// add non-matched text to the current mode buffer
modeBuffer += textBeforeMatch;
if (lexeme == null) {
processBuffer();
return 0;
}
// we've found a 0 width match and we're stuck, so we need to advance
// this happens when we have badly behaved rules that have optional matchers to the degree that
// sometimes they can end up matching nothing at all
// Ref: https://github.com/highlightjs/highlight.js/issues/2140
if (lastMatch.type === "begin" && match.type === "end" && lastMatch.index === match.index && lexeme === "") {
// spit the "skipped" character that our regex choked on back into the output sequence
modeBuffer += codeToHighlight.slice(match.index, match.index + 1);
if (!SAFE_MODE) {
/** @type {AnnotatedError} */
const err = new Error(`0 width match regex (${languageName})`);
err.languageName = languageName;
err.badRule = lastMatch.rule;
throw err;
}
return 1;
}
lastMatch = match;
if (match.type === "begin") {
return doBeginMatch(match);
} else if (match.type === "illegal" && !ignoreIllegals) {
// illegal match, we do not continue processing
/** @type {AnnotatedError} */
const err = new Error('Illegal lexeme "' + lexeme + '" for mode "' + (top.scope || '') + '"');
err.mode = top;
throw err;
} else if (match.type === "end") {
const processed = doEndMatch(match);
if (processed !== NO_MATCH) {
return processed;
}
}
// edge case for when illegal matches $ (end of line) which is technically
// a 0 width match but not a begin/end match so it's not caught by the
// first handler (when ignoreIllegals is true)
if (match.type === "illegal" && lexeme === "") {
// advance so we aren't stuck in an infinite loop
return 1;
}
// infinite loops are BAD, this is a last ditch catch all. if we have a
// decent number of iterations yet our index (cursor position in our
// parsing) still 3x behind our index then something is very wrong
// so we bail
if (iterations > 100000 && iterations > match.index * 3) {
const err = new Error('potential infinite loop, way more iterations than matches');
throw err;
}
/*
Why might be find ourselves here? An potential end match that was
triggered but could not be completed. IE, `doEndMatch` returned NO_MATCH.
(this could be because a callback requests the match be ignored, etc)
This causes no real harm other than stopping a few times too many.
*/
modeBuffer += lexeme;
return lexeme.length;
}
const language = getLanguage(languageName);
if (!language) {
error(LANGUAGE_NOT_FOUND.replace("{}", languageName));
throw new Error('Unknown language: "' + languageName + '"');
}
const md = compileLanguage(language);
let result = '';
/** @type {CompiledMode} */
let top = continuation || md;
/** @type Record */
const continuations = {}; // keep continuations for sub-languages
const emitter = new options.__emitter(options);
processContinuations();
let modeBuffer = '';
let relevance = 0;
let index = 0;
let iterations = 0;
let resumeScanAtSamePosition = false;
try {
top.matcher.considerAll();
for (;;) {
iterations++;
if (resumeScanAtSamePosition) {
// only regexes not matched previously will now be
// considered for a potential match
resumeScanAtSamePosition = false;
} else {
top.matcher.considerAll();
}
top.matcher.lastIndex = index;
const match = top.matcher.exec(codeToHighlight);
// console.log("match", match[0], match.rule && match.rule.begin)
if (!match) break;
const beforeMatch = codeToHighlight.substring(index, match.index);
const processedCount = processLexeme(beforeMatch, match);
index = match.index + processedCount;
}
processLexeme(codeToHighlight.substr(index));
emitter.closeAllNodes();
emitter.finalize();
result = emitter.toHTML();
return {
language: languageName,
value: result,
relevance: relevance,
illegal: false,
_emitter: emitter,
_top: top
};
} catch (err) {
if (err.message && err.message.includes('Illegal')) {
return {
language: languageName,
value: escape(codeToHighlight),
illegal: true,
relevance: 0,
_illegalBy: {
message: err.message,
index: index,
context: codeToHighlight.slice(index - 100, index + 100),
mode: err.mode,
resultSoFar: result
},
_emitter: emitter
};
} else if (SAFE_MODE) {
return {
language: languageName,
value: escape(codeToHighlight),
illegal: false,
relevance: 0,
errorRaised: err,
_emitter: emitter,
_top: top
};
} else {
throw err;
}
}
}
/**
* returns a valid highlight result, without actually doing any actual work,
* auto highlight starts with this and it's possible for small snippets that
* auto-detection may not find a better match
* @param {string} code
* @returns {HighlightResult}
*/
function justTextHighlightResult(code) {
const result = {
value: escape(code),
illegal: false,
relevance: 0,
_top: PLAINTEXT_LANGUAGE,
_emitter: new options.__emitter(options)
};
result._emitter.addText(code);
return result;
}
/**
Highlighting with language detection. Accepts a string with the code to
highlight. Returns an object with the following properties:
- language (detected language)
- relevance (int)
- value (an HTML string with highlighting markup)
- secondBest (object with the same structure for second-best heuristically
detected language, may be absent)
@param {string} code
@param {Array} [languageSubset]
@returns {AutoHighlightResult}
*/
function highlightAuto(code, languageSubset) {
languageSubset = languageSubset || options.languages || Object.keys(languages);
const plaintext = justTextHighlightResult(code);
const results = languageSubset.filter(getLanguage).filter(autoDetection).map(name =>
_highlight(name, code, false)
);
results.unshift(plaintext); // plaintext is always an option
const sorted = results.sort((a, b) => {
// sort base on relevance
if (a.relevance !== b.relevance) return b.relevance - a.relevance;
// always award the tie to the base language
// ie if C++ and Arduino are tied, it's more likely to be C++
if (a.language && b.language) {
if (getLanguage(a.language).supersetOf === b.language) {
return 1;
} else if (getLanguage(b.language).supersetOf === a.language) {
return -1;
}
}
// otherwise say they are equal, which has the effect of sorting on
// relevance while preserving the original ordering - which is how ties
// have historically been settled, ie the language that comes first always
// wins in the case of a tie
return 0;
});
const [best, secondBest] = sorted;
/** @type {AutoHighlightResult} */
const result = best;
result.secondBest = secondBest;
return result;
}
/**
* Builds new class name for block given the language name
*
* @param {HTMLElement} element
* @param {string} [currentLang]
* @param {string} [resultLang]
*/
function updateClassName(element, currentLang, resultLang) {
const language = (currentLang && aliases[currentLang]) || resultLang;
element.classList.add("hljs");
element.classList.add(`language-${language}`);
}
/**
* Applies highlighting to a DOM node containing code.
*
* @param {HighlightedHTMLElement} element - the HTML element to highlight
*/
function highlightElement(element) {
/** @type HTMLElement */
let node = null;
const language = blockLanguage(element);
if (shouldNotHighlight(language)) return;
fire("before:highlightElement",
{ el: element, language: language });
// we should be all text, no child nodes (unescaped HTML) - this is possibly
// an HTML injection attack - it's likely too late if this is already in
// production (the code has likely already done its damage by the time
// we're seeing it)... but we yell loudly about this so that hopefully it's
// more likely to be caught in development before making it to production
if (element.children.length > 0) {
if (!options.ignoreUnescapedHTML) {
console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk.");
console.warn("https://github.com/highlightjs/highlight.js/issues/2886");
console.warn(element);
}
if (options.throwUnescapedHTML) {
const err = new HTMLInjectionError(
"One of your code blocks includes unescaped HTML.",
element.innerHTML
);
throw err;
}
}
node = element;
const text = node.textContent;
const result = language ? highlight(text, { language, ignoreIllegals: true }) : highlightAuto(text);
element.innerHTML = result.value;
updateClassName(element, language, result.language);
element.result = {
language: result.language,
// TODO: remove with version 11.0
re: result.relevance,
relevance: result.relevance
};
if (result.secondBest) {
element.secondBest = {
language: result.secondBest.language,
relevance: result.secondBest.relevance
};
}
fire("after:highlightElement", { el: element, result, text });
}
/**
* Updates highlight.js global options with the passed options
*
* @param {Partial} userOptions
*/
function configure(userOptions) {
options = inherit(options, userOptions);
}
// TODO: remove v12, deprecated
const initHighlighting = () => {
highlightAll();
deprecated("10.6.0", "initHighlighting() deprecated. Use highlightAll() now.");
};
// TODO: remove v12, deprecated
function initHighlightingOnLoad() {
highlightAll();
deprecated("10.6.0", "initHighlightingOnLoad() deprecated. Use highlightAll() now.");
}
let wantsHighlight = false;
/**
* auto-highlights all pre>code elements on the page
*/
function highlightAll() {
// if we are called too early in the loading process
if (document.readyState === "loading") {
wantsHighlight = true;
return;
}
const blocks = document.querySelectorAll(options.cssSelector);
blocks.forEach(highlightElement);
}
function boot() {
// if a highlight was requested before DOM was loaded, do now
if (wantsHighlight) highlightAll();
}
// make sure we are in the browser environment
if (typeof window !== 'undefined' && window.addEventListener) {
window.addEventListener('DOMContentLoaded', boot, false);
}
/**
* Register a language grammar module
*
* @param {string} languageName
* @param {LanguageFn} languageDefinition
*/
function registerLanguage(languageName, languageDefinition) {
let lang = null;
try {
lang = languageDefinition(hljs);
} catch (error$1) {
error("Language definition for '{}' could not be registered.".replace("{}", languageName));
// hard or soft error
if (!SAFE_MODE) { throw error$1; } else { error(error$1); }
// languages that have serious errors are replaced with essentially a
// "plaintext" stand-in so that the code blocks will still get normal
// css classes applied to them - and one bad language won't break the
// entire highlighter
lang = PLAINTEXT_LANGUAGE;
}
// give it a temporary name if it doesn't have one in the meta-data
if (!lang.name) lang.name = languageName;
languages[languageName] = lang;
lang.rawDefinition = languageDefinition.bind(null, hljs);
if (lang.aliases) {
registerAliases(lang.aliases, { languageName });
}
}
/**
* Remove a language grammar module
*
* @param {string} languageName
*/
function unregisterLanguage(languageName) {
delete languages[languageName];
for (const alias of Object.keys(aliases)) {
if (aliases[alias] === languageName) {
delete aliases[alias];
}
}
}
/**
* @returns {string[]} List of language internal names
*/
function listLanguages() {
return Object.keys(languages);
}
/**
* @param {string} name - name of the language to retrieve
* @returns {Language | undefined}
*/
function getLanguage(name) {
name = (name || '').toLowerCase();
return languages[name] || languages[aliases[name]];
}
/**
*
* @param {string|string[]} aliasList - single alias or list of aliases
* @param {{languageName: string}} opts
*/
function registerAliases(aliasList, { languageName }) {
if (typeof aliasList === 'string') {
aliasList = [aliasList];
}
aliasList.forEach(alias => { aliases[alias.toLowerCase()] = languageName; });
}
/**
* Determines if a given language has auto-detection enabled
* @param {string} name - name of the language
*/
function autoDetection(name) {
const lang = getLanguage(name);
return lang && !lang.disableAutodetect;
}
/**
* Upgrades the old highlightBlock plugins to the new
* highlightElement API
* @param {HLJSPlugin} plugin
*/
function upgradePluginAPI(plugin) {
// TODO: remove with v12
if (plugin["before:highlightBlock"] && !plugin["before:highlightElement"]) {
plugin["before:highlightElement"] = (data) => {
plugin["before:highlightBlock"](
Object.assign({ block: data.el }, data)
);
};
}
if (plugin["after:highlightBlock"] && !plugin["after:highlightElement"]) {
plugin["after:highlightElement"] = (data) => {
plugin["after:highlightBlock"](
Object.assign({ block: data.el }, data)
);
};
}
}
/**
* @param {HLJSPlugin} plugin
*/
function addPlugin(plugin) {
upgradePluginAPI(plugin);
plugins.push(plugin);
}
/**
*
* @param {PluginEvent} event
* @param {any} args
*/
function fire(event, args) {
const cb = event;
plugins.forEach(function(plugin) {
if (plugin[cb]) {
plugin[cb](args);
}
});
}
/**
* DEPRECATED
* @param {HighlightedHTMLElement} el
*/
function deprecateHighlightBlock(el) {
deprecated("10.7.0", "highlightBlock will be removed entirely in v12.0");
deprecated("10.7.0", "Please use highlightElement now.");
return highlightElement(el);
}
/* Interface definition */
Object.assign(hljs, {
highlight,
highlightAuto,
highlightAll,
highlightElement,
// TODO: Remove with v12 API
highlightBlock: deprecateHighlightBlock,
configure,
initHighlighting,
initHighlightingOnLoad,
registerLanguage,
unregisterLanguage,
listLanguages,
getLanguage,
registerAliases,
autoDetection,
inherit,
addPlugin
});
hljs.debugMode = function() { SAFE_MODE = false; };
hljs.safeMode = function() { SAFE_MODE = true; };
hljs.versionString = version;
hljs.regex = {
concat: concat,
lookahead: lookahead,
either: either,
optional: optional,
anyNumberOfTimes: anyNumberOfTimes
};
for (const key in MODES) {
// @ts-ignore
if (typeof MODES[key] === "object") {
// @ts-ignore
deepFreeze$1(MODES[key]);
}
}
// merge all the modes/regexes into our main object
Object.assign(hljs, MODES);
return hljs;
};
// export an "instance" of the highlighter
var highlight = HLJS({});
module.exports = highlight;
highlight.HighlightJS = highlight;
highlight.default = highlight;
/***/ }),
/***/ "./node_modules/highlight.js/lib/index.js":
/*!************************************************!*\
!*** ./node_modules/highlight.js/lib/index.js ***!
\************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
var hljs = __webpack_require__(/*! ./core */ "./node_modules/highlight.js/lib/core.js");
hljs.registerLanguage('1c', __webpack_require__(/*! ./languages/1c */ "./node_modules/highlight.js/lib/languages/1c.js"));
hljs.registerLanguage('abnf', __webpack_require__(/*! ./languages/abnf */ "./node_modules/highlight.js/lib/languages/abnf.js"));
hljs.registerLanguage('accesslog', __webpack_require__(/*! ./languages/accesslog */ "./node_modules/highlight.js/lib/languages/accesslog.js"));
hljs.registerLanguage('actionscript', __webpack_require__(/*! ./languages/actionscript */ "./node_modules/highlight.js/lib/languages/actionscript.js"));
hljs.registerLanguage('ada', __webpack_require__(/*! ./languages/ada */ "./node_modules/highlight.js/lib/languages/ada.js"));
hljs.registerLanguage('angelscript', __webpack_require__(/*! ./languages/angelscript */ "./node_modules/highlight.js/lib/languages/angelscript.js"));
hljs.registerLanguage('apache', __webpack_require__(/*! ./languages/apache */ "./node_modules/highlight.js/lib/languages/apache.js"));
hljs.registerLanguage('applescript', __webpack_require__(/*! ./languages/applescript */ "./node_modules/highlight.js/lib/languages/applescript.js"));
hljs.registerLanguage('arcade', __webpack_require__(/*! ./languages/arcade */ "./node_modules/highlight.js/lib/languages/arcade.js"));
hljs.registerLanguage('arduino', __webpack_require__(/*! ./languages/arduino */ "./node_modules/highlight.js/lib/languages/arduino.js"));
hljs.registerLanguage('armasm', __webpack_require__(/*! ./languages/armasm */ "./node_modules/highlight.js/lib/languages/armasm.js"));
hljs.registerLanguage('xml', __webpack_require__(/*! ./languages/xml */ "./node_modules/highlight.js/lib/languages/xml.js"));
hljs.registerLanguage('asciidoc', __webpack_require__(/*! ./languages/asciidoc */ "./node_modules/highlight.js/lib/languages/asciidoc.js"));
hljs.registerLanguage('aspectj', __webpack_require__(/*! ./languages/aspectj */ "./node_modules/highlight.js/lib/languages/aspectj.js"));
hljs.registerLanguage('autohotkey', __webpack_require__(/*! ./languages/autohotkey */ "./node_modules/highlight.js/lib/languages/autohotkey.js"));
hljs.registerLanguage('autoit', __webpack_require__(/*! ./languages/autoit */ "./node_modules/highlight.js/lib/languages/autoit.js"));
hljs.registerLanguage('avrasm', __webpack_require__(/*! ./languages/avrasm */ "./node_modules/highlight.js/lib/languages/avrasm.js"));
hljs.registerLanguage('awk', __webpack_require__(/*! ./languages/awk */ "./node_modules/highlight.js/lib/languages/awk.js"));
hljs.registerLanguage('axapta', __webpack_require__(/*! ./languages/axapta */ "./node_modules/highlight.js/lib/languages/axapta.js"));
hljs.registerLanguage('bash', __webpack_require__(/*! ./languages/bash */ "./node_modules/highlight.js/lib/languages/bash.js"));
hljs.registerLanguage('basic', __webpack_require__(/*! ./languages/basic */ "./node_modules/highlight.js/lib/languages/basic.js"));
hljs.registerLanguage('bnf', __webpack_require__(/*! ./languages/bnf */ "./node_modules/highlight.js/lib/languages/bnf.js"));
hljs.registerLanguage('brainfuck', __webpack_require__(/*! ./languages/brainfuck */ "./node_modules/highlight.js/lib/languages/brainfuck.js"));
hljs.registerLanguage('c', __webpack_require__(/*! ./languages/c */ "./node_modules/highlight.js/lib/languages/c.js"));
hljs.registerLanguage('cal', __webpack_require__(/*! ./languages/cal */ "./node_modules/highlight.js/lib/languages/cal.js"));
hljs.registerLanguage('capnproto', __webpack_require__(/*! ./languages/capnproto */ "./node_modules/highlight.js/lib/languages/capnproto.js"));
hljs.registerLanguage('ceylon', __webpack_require__(/*! ./languages/ceylon */ "./node_modules/highlight.js/lib/languages/ceylon.js"));
hljs.registerLanguage('clean', __webpack_require__(/*! ./languages/clean */ "./node_modules/highlight.js/lib/languages/clean.js"));
hljs.registerLanguage('clojure', __webpack_require__(/*! ./languages/clojure */ "./node_modules/highlight.js/lib/languages/clojure.js"));
hljs.registerLanguage('clojure-repl', __webpack_require__(/*! ./languages/clojure-repl */ "./node_modules/highlight.js/lib/languages/clojure-repl.js"));
hljs.registerLanguage('cmake', __webpack_require__(/*! ./languages/cmake */ "./node_modules/highlight.js/lib/languages/cmake.js"));
hljs.registerLanguage('coffeescript', __webpack_require__(/*! ./languages/coffeescript */ "./node_modules/highlight.js/lib/languages/coffeescript.js"));
hljs.registerLanguage('coq', __webpack_require__(/*! ./languages/coq */ "./node_modules/highlight.js/lib/languages/coq.js"));
hljs.registerLanguage('cos', __webpack_require__(/*! ./languages/cos */ "./node_modules/highlight.js/lib/languages/cos.js"));
hljs.registerLanguage('cpp', __webpack_require__(/*! ./languages/cpp */ "./node_modules/highlight.js/lib/languages/cpp.js"));
hljs.registerLanguage('crmsh', __webpack_require__(/*! ./languages/crmsh */ "./node_modules/highlight.js/lib/languages/crmsh.js"));
hljs.registerLanguage('crystal', __webpack_require__(/*! ./languages/crystal */ "./node_modules/highlight.js/lib/languages/crystal.js"));
hljs.registerLanguage('csharp', __webpack_require__(/*! ./languages/csharp */ "./node_modules/highlight.js/lib/languages/csharp.js"));
hljs.registerLanguage('csp', __webpack_require__(/*! ./languages/csp */ "./node_modules/highlight.js/lib/languages/csp.js"));
hljs.registerLanguage('css', __webpack_require__(/*! ./languages/css */ "./node_modules/highlight.js/lib/languages/css.js"));
hljs.registerLanguage('d', __webpack_require__(/*! ./languages/d */ "./node_modules/highlight.js/lib/languages/d.js"));
hljs.registerLanguage('markdown', __webpack_require__(/*! ./languages/markdown */ "./node_modules/highlight.js/lib/languages/markdown.js"));
hljs.registerLanguage('dart', __webpack_require__(/*! ./languages/dart */ "./node_modules/highlight.js/lib/languages/dart.js"));
hljs.registerLanguage('delphi', __webpack_require__(/*! ./languages/delphi */ "./node_modules/highlight.js/lib/languages/delphi.js"));
hljs.registerLanguage('diff', __webpack_require__(/*! ./languages/diff */ "./node_modules/highlight.js/lib/languages/diff.js"));
hljs.registerLanguage('django', __webpack_require__(/*! ./languages/django */ "./node_modules/highlight.js/lib/languages/django.js"));
hljs.registerLanguage('dns', __webpack_require__(/*! ./languages/dns */ "./node_modules/highlight.js/lib/languages/dns.js"));
hljs.registerLanguage('dockerfile', __webpack_require__(/*! ./languages/dockerfile */ "./node_modules/highlight.js/lib/languages/dockerfile.js"));
hljs.registerLanguage('dos', __webpack_require__(/*! ./languages/dos */ "./node_modules/highlight.js/lib/languages/dos.js"));
hljs.registerLanguage('dsconfig', __webpack_require__(/*! ./languages/dsconfig */ "./node_modules/highlight.js/lib/languages/dsconfig.js"));
hljs.registerLanguage('dts', __webpack_require__(/*! ./languages/dts */ "./node_modules/highlight.js/lib/languages/dts.js"));
hljs.registerLanguage('dust', __webpack_require__(/*! ./languages/dust */ "./node_modules/highlight.js/lib/languages/dust.js"));
hljs.registerLanguage('ebnf', __webpack_require__(/*! ./languages/ebnf */ "./node_modules/highlight.js/lib/languages/ebnf.js"));
hljs.registerLanguage('elixir', __webpack_require__(/*! ./languages/elixir */ "./node_modules/highlight.js/lib/languages/elixir.js"));
hljs.registerLanguage('elm', __webpack_require__(/*! ./languages/elm */ "./node_modules/highlight.js/lib/languages/elm.js"));
hljs.registerLanguage('ruby', __webpack_require__(/*! ./languages/ruby */ "./node_modules/highlight.js/lib/languages/ruby.js"));
hljs.registerLanguage('erb', __webpack_require__(/*! ./languages/erb */ "./node_modules/highlight.js/lib/languages/erb.js"));
hljs.registerLanguage('erlang-repl', __webpack_require__(/*! ./languages/erlang-repl */ "./node_modules/highlight.js/lib/languages/erlang-repl.js"));
hljs.registerLanguage('erlang', __webpack_require__(/*! ./languages/erlang */ "./node_modules/highlight.js/lib/languages/erlang.js"));
hljs.registerLanguage('excel', __webpack_require__(/*! ./languages/excel */ "./node_modules/highlight.js/lib/languages/excel.js"));
hljs.registerLanguage('fix', __webpack_require__(/*! ./languages/fix */ "./node_modules/highlight.js/lib/languages/fix.js"));
hljs.registerLanguage('flix', __webpack_require__(/*! ./languages/flix */ "./node_modules/highlight.js/lib/languages/flix.js"));
hljs.registerLanguage('fortran', __webpack_require__(/*! ./languages/fortran */ "./node_modules/highlight.js/lib/languages/fortran.js"));
hljs.registerLanguage('fsharp', __webpack_require__(/*! ./languages/fsharp */ "./node_modules/highlight.js/lib/languages/fsharp.js"));
hljs.registerLanguage('gams', __webpack_require__(/*! ./languages/gams */ "./node_modules/highlight.js/lib/languages/gams.js"));
hljs.registerLanguage('gauss', __webpack_require__(/*! ./languages/gauss */ "./node_modules/highlight.js/lib/languages/gauss.js"));
hljs.registerLanguage('gcode', __webpack_require__(/*! ./languages/gcode */ "./node_modules/highlight.js/lib/languages/gcode.js"));
hljs.registerLanguage('gherkin', __webpack_require__(/*! ./languages/gherkin */ "./node_modules/highlight.js/lib/languages/gherkin.js"));
hljs.registerLanguage('glsl', __webpack_require__(/*! ./languages/glsl */ "./node_modules/highlight.js/lib/languages/glsl.js"));
hljs.registerLanguage('gml', __webpack_require__(/*! ./languages/gml */ "./node_modules/highlight.js/lib/languages/gml.js"));
hljs.registerLanguage('go', __webpack_require__(/*! ./languages/go */ "./node_modules/highlight.js/lib/languages/go.js"));
hljs.registerLanguage('golo', __webpack_require__(/*! ./languages/golo */ "./node_modules/highlight.js/lib/languages/golo.js"));
hljs.registerLanguage('gradle', __webpack_require__(/*! ./languages/gradle */ "./node_modules/highlight.js/lib/languages/gradle.js"));
hljs.registerLanguage('groovy', __webpack_require__(/*! ./languages/groovy */ "./node_modules/highlight.js/lib/languages/groovy.js"));
hljs.registerLanguage('haml', __webpack_require__(/*! ./languages/haml */ "./node_modules/highlight.js/lib/languages/haml.js"));
hljs.registerLanguage('handlebars', __webpack_require__(/*! ./languages/handlebars */ "./node_modules/highlight.js/lib/languages/handlebars.js"));
hljs.registerLanguage('haskell', __webpack_require__(/*! ./languages/haskell */ "./node_modules/highlight.js/lib/languages/haskell.js"));
hljs.registerLanguage('haxe', __webpack_require__(/*! ./languages/haxe */ "./node_modules/highlight.js/lib/languages/haxe.js"));
hljs.registerLanguage('hsp', __webpack_require__(/*! ./languages/hsp */ "./node_modules/highlight.js/lib/languages/hsp.js"));
hljs.registerLanguage('http', __webpack_require__(/*! ./languages/http */ "./node_modules/highlight.js/lib/languages/http.js"));
hljs.registerLanguage('hy', __webpack_require__(/*! ./languages/hy */ "./node_modules/highlight.js/lib/languages/hy.js"));
hljs.registerLanguage('inform7', __webpack_require__(/*! ./languages/inform7 */ "./node_modules/highlight.js/lib/languages/inform7.js"));
hljs.registerLanguage('ini', __webpack_require__(/*! ./languages/ini */ "./node_modules/highlight.js/lib/languages/ini.js"));
hljs.registerLanguage('irpf90', __webpack_require__(/*! ./languages/irpf90 */ "./node_modules/highlight.js/lib/languages/irpf90.js"));
hljs.registerLanguage('isbl', __webpack_require__(/*! ./languages/isbl */ "./node_modules/highlight.js/lib/languages/isbl.js"));
hljs.registerLanguage('java', __webpack_require__(/*! ./languages/java */ "./node_modules/highlight.js/lib/languages/java.js"));
hljs.registerLanguage('javascript', __webpack_require__(/*! ./languages/javascript */ "./node_modules/highlight.js/lib/languages/javascript.js"));
hljs.registerLanguage('jboss-cli', __webpack_require__(/*! ./languages/jboss-cli */ "./node_modules/highlight.js/lib/languages/jboss-cli.js"));
hljs.registerLanguage('json', __webpack_require__(/*! ./languages/json */ "./node_modules/highlight.js/lib/languages/json.js"));
hljs.registerLanguage('julia', __webpack_require__(/*! ./languages/julia */ "./node_modules/highlight.js/lib/languages/julia.js"));
hljs.registerLanguage('julia-repl', __webpack_require__(/*! ./languages/julia-repl */ "./node_modules/highlight.js/lib/languages/julia-repl.js"));
hljs.registerLanguage('kotlin', __webpack_require__(/*! ./languages/kotlin */ "./node_modules/highlight.js/lib/languages/kotlin.js"));
hljs.registerLanguage('lasso', __webpack_require__(/*! ./languages/lasso */ "./node_modules/highlight.js/lib/languages/lasso.js"));
hljs.registerLanguage('latex', __webpack_require__(/*! ./languages/latex */ "./node_modules/highlight.js/lib/languages/latex.js"));
hljs.registerLanguage('ldif', __webpack_require__(/*! ./languages/ldif */ "./node_modules/highlight.js/lib/languages/ldif.js"));
hljs.registerLanguage('leaf', __webpack_require__(/*! ./languages/leaf */ "./node_modules/highlight.js/lib/languages/leaf.js"));
hljs.registerLanguage('less', __webpack_require__(/*! ./languages/less */ "./node_modules/highlight.js/lib/languages/less.js"));
hljs.registerLanguage('lisp', __webpack_require__(/*! ./languages/lisp */ "./node_modules/highlight.js/lib/languages/lisp.js"));
hljs.registerLanguage('livecodeserver', __webpack_require__(/*! ./languages/livecodeserver */ "./node_modules/highlight.js/lib/languages/livecodeserver.js"));
hljs.registerLanguage('livescript', __webpack_require__(/*! ./languages/livescript */ "./node_modules/highlight.js/lib/languages/livescript.js"));
hljs.registerLanguage('llvm', __webpack_require__(/*! ./languages/llvm */ "./node_modules/highlight.js/lib/languages/llvm.js"));
hljs.registerLanguage('lsl', __webpack_require__(/*! ./languages/lsl */ "./node_modules/highlight.js/lib/languages/lsl.js"));
hljs.registerLanguage('lua', __webpack_require__(/*! ./languages/lua */ "./node_modules/highlight.js/lib/languages/lua.js"));
hljs.registerLanguage('makefile', __webpack_require__(/*! ./languages/makefile */ "./node_modules/highlight.js/lib/languages/makefile.js"));
hljs.registerLanguage('mathematica', __webpack_require__(/*! ./languages/mathematica */ "./node_modules/highlight.js/lib/languages/mathematica.js"));
hljs.registerLanguage('matlab', __webpack_require__(/*! ./languages/matlab */ "./node_modules/highlight.js/lib/languages/matlab.js"));
hljs.registerLanguage('maxima', __webpack_require__(/*! ./languages/maxima */ "./node_modules/highlight.js/lib/languages/maxima.js"));
hljs.registerLanguage('mel', __webpack_require__(/*! ./languages/mel */ "./node_modules/highlight.js/lib/languages/mel.js"));
hljs.registerLanguage('mercury', __webpack_require__(/*! ./languages/mercury */ "./node_modules/highlight.js/lib/languages/mercury.js"));
hljs.registerLanguage('mipsasm', __webpack_require__(/*! ./languages/mipsasm */ "./node_modules/highlight.js/lib/languages/mipsasm.js"));
hljs.registerLanguage('mizar', __webpack_require__(/*! ./languages/mizar */ "./node_modules/highlight.js/lib/languages/mizar.js"));
hljs.registerLanguage('perl', __webpack_require__(/*! ./languages/perl */ "./node_modules/highlight.js/lib/languages/perl.js"));
hljs.registerLanguage('mojolicious', __webpack_require__(/*! ./languages/mojolicious */ "./node_modules/highlight.js/lib/languages/mojolicious.js"));
hljs.registerLanguage('monkey', __webpack_require__(/*! ./languages/monkey */ "./node_modules/highlight.js/lib/languages/monkey.js"));
hljs.registerLanguage('moonscript', __webpack_require__(/*! ./languages/moonscript */ "./node_modules/highlight.js/lib/languages/moonscript.js"));
hljs.registerLanguage('n1ql', __webpack_require__(/*! ./languages/n1ql */ "./node_modules/highlight.js/lib/languages/n1ql.js"));
hljs.registerLanguage('nestedtext', __webpack_require__(/*! ./languages/nestedtext */ "./node_modules/highlight.js/lib/languages/nestedtext.js"));
hljs.registerLanguage('nginx', __webpack_require__(/*! ./languages/nginx */ "./node_modules/highlight.js/lib/languages/nginx.js"));
hljs.registerLanguage('nim', __webpack_require__(/*! ./languages/nim */ "./node_modules/highlight.js/lib/languages/nim.js"));
hljs.registerLanguage('nix', __webpack_require__(/*! ./languages/nix */ "./node_modules/highlight.js/lib/languages/nix.js"));
hljs.registerLanguage('node-repl', __webpack_require__(/*! ./languages/node-repl */ "./node_modules/highlight.js/lib/languages/node-repl.js"));
hljs.registerLanguage('nsis', __webpack_require__(/*! ./languages/nsis */ "./node_modules/highlight.js/lib/languages/nsis.js"));
hljs.registerLanguage('objectivec', __webpack_require__(/*! ./languages/objectivec */ "./node_modules/highlight.js/lib/languages/objectivec.js"));
hljs.registerLanguage('ocaml', __webpack_require__(/*! ./languages/ocaml */ "./node_modules/highlight.js/lib/languages/ocaml.js"));
hljs.registerLanguage('openscad', __webpack_require__(/*! ./languages/openscad */ "./node_modules/highlight.js/lib/languages/openscad.js"));
hljs.registerLanguage('oxygene', __webpack_require__(/*! ./languages/oxygene */ "./node_modules/highlight.js/lib/languages/oxygene.js"));
hljs.registerLanguage('parser3', __webpack_require__(/*! ./languages/parser3 */ "./node_modules/highlight.js/lib/languages/parser3.js"));
hljs.registerLanguage('pf', __webpack_require__(/*! ./languages/pf */ "./node_modules/highlight.js/lib/languages/pf.js"));
hljs.registerLanguage('pgsql', __webpack_require__(/*! ./languages/pgsql */ "./node_modules/highlight.js/lib/languages/pgsql.js"));
hljs.registerLanguage('php', __webpack_require__(/*! ./languages/php */ "./node_modules/highlight.js/lib/languages/php.js"));
hljs.registerLanguage('php-template', __webpack_require__(/*! ./languages/php-template */ "./node_modules/highlight.js/lib/languages/php-template.js"));
hljs.registerLanguage('plaintext', __webpack_require__(/*! ./languages/plaintext */ "./node_modules/highlight.js/lib/languages/plaintext.js"));
hljs.registerLanguage('pony', __webpack_require__(/*! ./languages/pony */ "./node_modules/highlight.js/lib/languages/pony.js"));
hljs.registerLanguage('powershell', __webpack_require__(/*! ./languages/powershell */ "./node_modules/highlight.js/lib/languages/powershell.js"));
hljs.registerLanguage('processing', __webpack_require__(/*! ./languages/processing */ "./node_modules/highlight.js/lib/languages/processing.js"));
hljs.registerLanguage('profile', __webpack_require__(/*! ./languages/profile */ "./node_modules/highlight.js/lib/languages/profile.js"));
hljs.registerLanguage('prolog', __webpack_require__(/*! ./languages/prolog */ "./node_modules/highlight.js/lib/languages/prolog.js"));
hljs.registerLanguage('properties', __webpack_require__(/*! ./languages/properties */ "./node_modules/highlight.js/lib/languages/properties.js"));
hljs.registerLanguage('protobuf', __webpack_require__(/*! ./languages/protobuf */ "./node_modules/highlight.js/lib/languages/protobuf.js"));
hljs.registerLanguage('puppet', __webpack_require__(/*! ./languages/puppet */ "./node_modules/highlight.js/lib/languages/puppet.js"));
hljs.registerLanguage('purebasic', __webpack_require__(/*! ./languages/purebasic */ "./node_modules/highlight.js/lib/languages/purebasic.js"));
hljs.registerLanguage('python', __webpack_require__(/*! ./languages/python */ "./node_modules/highlight.js/lib/languages/python.js"));
hljs.registerLanguage('python-repl', __webpack_require__(/*! ./languages/python-repl */ "./node_modules/highlight.js/lib/languages/python-repl.js"));
hljs.registerLanguage('q', __webpack_require__(/*! ./languages/q */ "./node_modules/highlight.js/lib/languages/q.js"));
hljs.registerLanguage('qml', __webpack_require__(/*! ./languages/qml */ "./node_modules/highlight.js/lib/languages/qml.js"));
hljs.registerLanguage('r', __webpack_require__(/*! ./languages/r */ "./node_modules/highlight.js/lib/languages/r.js"));
hljs.registerLanguage('reasonml', __webpack_require__(/*! ./languages/reasonml */ "./node_modules/highlight.js/lib/languages/reasonml.js"));
hljs.registerLanguage('rib', __webpack_require__(/*! ./languages/rib */ "./node_modules/highlight.js/lib/languages/rib.js"));
hljs.registerLanguage('roboconf', __webpack_require__(/*! ./languages/roboconf */ "./node_modules/highlight.js/lib/languages/roboconf.js"));
hljs.registerLanguage('routeros', __webpack_require__(/*! ./languages/routeros */ "./node_modules/highlight.js/lib/languages/routeros.js"));
hljs.registerLanguage('rsl', __webpack_require__(/*! ./languages/rsl */ "./node_modules/highlight.js/lib/languages/rsl.js"));
hljs.registerLanguage('ruleslanguage', __webpack_require__(/*! ./languages/ruleslanguage */ "./node_modules/highlight.js/lib/languages/ruleslanguage.js"));
hljs.registerLanguage('rust', __webpack_require__(/*! ./languages/rust */ "./node_modules/highlight.js/lib/languages/rust.js"));
hljs.registerLanguage('sas', __webpack_require__(/*! ./languages/sas */ "./node_modules/highlight.js/lib/languages/sas.js"));
hljs.registerLanguage('scala', __webpack_require__(/*! ./languages/scala */ "./node_modules/highlight.js/lib/languages/scala.js"));
hljs.registerLanguage('scheme', __webpack_require__(/*! ./languages/scheme */ "./node_modules/highlight.js/lib/languages/scheme.js"));
hljs.registerLanguage('scilab', __webpack_require__(/*! ./languages/scilab */ "./node_modules/highlight.js/lib/languages/scilab.js"));
hljs.registerLanguage('scss', __webpack_require__(/*! ./languages/scss */ "./node_modules/highlight.js/lib/languages/scss.js"));
hljs.registerLanguage('shell', __webpack_require__(/*! ./languages/shell */ "./node_modules/highlight.js/lib/languages/shell.js"));
hljs.registerLanguage('smali', __webpack_require__(/*! ./languages/smali */ "./node_modules/highlight.js/lib/languages/smali.js"));
hljs.registerLanguage('smalltalk', __webpack_require__(/*! ./languages/smalltalk */ "./node_modules/highlight.js/lib/languages/smalltalk.js"));
hljs.registerLanguage('sml', __webpack_require__(/*! ./languages/sml */ "./node_modules/highlight.js/lib/languages/sml.js"));
hljs.registerLanguage('sqf', __webpack_require__(/*! ./languages/sqf */ "./node_modules/highlight.js/lib/languages/sqf.js"));
hljs.registerLanguage('sql', __webpack_require__(/*! ./languages/sql */ "./node_modules/highlight.js/lib/languages/sql.js"));
hljs.registerLanguage('stan', __webpack_require__(/*! ./languages/stan */ "./node_modules/highlight.js/lib/languages/stan.js"));
hljs.registerLanguage('stata', __webpack_require__(/*! ./languages/stata */ "./node_modules/highlight.js/lib/languages/stata.js"));
hljs.registerLanguage('step21', __webpack_require__(/*! ./languages/step21 */ "./node_modules/highlight.js/lib/languages/step21.js"));
hljs.registerLanguage('stylus', __webpack_require__(/*! ./languages/stylus */ "./node_modules/highlight.js/lib/languages/stylus.js"));
hljs.registerLanguage('subunit', __webpack_require__(/*! ./languages/subunit */ "./node_modules/highlight.js/lib/languages/subunit.js"));
hljs.registerLanguage('swift', __webpack_require__(/*! ./languages/swift */ "./node_modules/highlight.js/lib/languages/swift.js"));
hljs.registerLanguage('taggerscript', __webpack_require__(/*! ./languages/taggerscript */ "./node_modules/highlight.js/lib/languages/taggerscript.js"));
hljs.registerLanguage('yaml', __webpack_require__(/*! ./languages/yaml */ "./node_modules/highlight.js/lib/languages/yaml.js"));
hljs.registerLanguage('tap', __webpack_require__(/*! ./languages/tap */ "./node_modules/highlight.js/lib/languages/tap.js"));
hljs.registerLanguage('tcl', __webpack_require__(/*! ./languages/tcl */ "./node_modules/highlight.js/lib/languages/tcl.js"));
hljs.registerLanguage('thrift', __webpack_require__(/*! ./languages/thrift */ "./node_modules/highlight.js/lib/languages/thrift.js"));
hljs.registerLanguage('tp', __webpack_require__(/*! ./languages/tp */ "./node_modules/highlight.js/lib/languages/tp.js"));
hljs.registerLanguage('twig', __webpack_require__(/*! ./languages/twig */ "./node_modules/highlight.js/lib/languages/twig.js"));
hljs.registerLanguage('typescript', __webpack_require__(/*! ./languages/typescript */ "./node_modules/highlight.js/lib/languages/typescript.js"));
hljs.registerLanguage('vala', __webpack_require__(/*! ./languages/vala */ "./node_modules/highlight.js/lib/languages/vala.js"));
hljs.registerLanguage('vbnet', __webpack_require__(/*! ./languages/vbnet */ "./node_modules/highlight.js/lib/languages/vbnet.js"));
hljs.registerLanguage('vbscript', __webpack_require__(/*! ./languages/vbscript */ "./node_modules/highlight.js/lib/languages/vbscript.js"));
hljs.registerLanguage('vbscript-html', __webpack_require__(/*! ./languages/vbscript-html */ "./node_modules/highlight.js/lib/languages/vbscript-html.js"));
hljs.registerLanguage('verilog', __webpack_require__(/*! ./languages/verilog */ "./node_modules/highlight.js/lib/languages/verilog.js"));
hljs.registerLanguage('vhdl', __webpack_require__(/*! ./languages/vhdl */ "./node_modules/highlight.js/lib/languages/vhdl.js"));
hljs.registerLanguage('vim', __webpack_require__(/*! ./languages/vim */ "./node_modules/highlight.js/lib/languages/vim.js"));
hljs.registerLanguage('wasm', __webpack_require__(/*! ./languages/wasm */ "./node_modules/highlight.js/lib/languages/wasm.js"));
hljs.registerLanguage('wren', __webpack_require__(/*! ./languages/wren */ "./node_modules/highlight.js/lib/languages/wren.js"));
hljs.registerLanguage('x86asm', __webpack_require__(/*! ./languages/x86asm */ "./node_modules/highlight.js/lib/languages/x86asm.js"));
hljs.registerLanguage('xl', __webpack_require__(/*! ./languages/xl */ "./node_modules/highlight.js/lib/languages/xl.js"));
hljs.registerLanguage('xquery', __webpack_require__(/*! ./languages/xquery */ "./node_modules/highlight.js/lib/languages/xquery.js"));
hljs.registerLanguage('zephir', __webpack_require__(/*! ./languages/zephir */ "./node_modules/highlight.js/lib/languages/zephir.js"));
hljs.HighlightJS = hljs
hljs.default = hljs
module.exports = hljs;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/1c.js":
/*!*******************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/1c.js ***!
\*******************************************************/
/***/ ((module) => {
/*
Language: 1C:Enterprise
Author: Stanislav Belov
Description: built-in language 1C:Enterprise (v7, v8)
Category: enterprise
*/
function _1c(hljs) {
// общий паттерн для определения идентификаторов
var UNDERSCORE_IDENT_RE = '[A-Za-zА-Яа-яёЁ_][A-Za-zА-Яа-яёЁ_0-9]+';
// v7 уникальные ключевые слова, отсутствующие в v8 ==> keyword
var v7_keywords =
'далее ';
// v8 ключевые слова ==> keyword
var v8_keywords =
'возврат вызватьисключение выполнить для если и из или иначе иначеесли исключение каждого конецесли ' +
'конецпопытки конеццикла не новый перейти перем по пока попытка прервать продолжить тогда цикл экспорт ';
// keyword : ключевые слова
var KEYWORD = v7_keywords + v8_keywords;
// v7 уникальные директивы, отсутствующие в v8 ==> meta-keyword
var v7_meta_keywords =
'загрузитьизфайла ';
// v8 ключевые слова в инструкциях препроцессора, директивах компиляции, аннотациях ==> meta-keyword
var v8_meta_keywords =
'вебклиент вместо внешнеесоединение клиент конецобласти мобильноеприложениеклиент мобильноеприложениесервер ' +
'наклиенте наклиентенасервере наклиентенасерверебезконтекста насервере насерверебезконтекста область перед ' +
'после сервер толстыйклиентобычноеприложение толстыйклиентуправляемоеприложение тонкийклиент ';
// meta-keyword : ключевые слова в инструкциях препроцессора, директивах компиляции, аннотациях
var METAKEYWORD = v7_meta_keywords + v8_meta_keywords;
// v7 системные константы ==> built_in
var v7_system_constants =
'разделительстраниц разделительстрок символтабуляции ';
// v7 уникальные методы глобального контекста, отсутствующие в v8 ==> built_in
var v7_global_context_methods =
'ansitooem oemtoansi ввестивидсубконто ввестиперечисление ввестипериод ввестиплансчетов выбранныйплансчетов ' +
'датагод датамесяц датачисло заголовоксистемы значениевстроку значениеизстроки каталогиб каталогпользователя ' +
'кодсимв конгода конецпериодаби конецрассчитанногопериодаби конецстандартногоинтервала конквартала конмесяца ' +
'коннедели лог лог10 максимальноеколичествосубконто названиеинтерфейса названиенабораправ назначитьвид ' +
'назначитьсчет найтиссылки началопериодаби началостандартногоинтервала начгода начквартала начмесяца ' +
'начнедели номерднягода номерднянедели номернеделигода обработкаожидания основнойжурналрасчетов ' +
'основнойплансчетов основнойязык очиститьокносообщений периодстр получитьвремята получитьдатута ' +
'получитьдокументта получитьзначенияотбора получитьпозициюта получитьпустоезначение получитьта ' +
'префиксавтонумерации пропись пустоезначение разм разобратьпозициюдокумента рассчитатьрегистрына ' +
'рассчитатьрегистрыпо симв создатьобъект статусвозврата стрколичествострок сформироватьпозициюдокумента ' +
'счетпокоду текущеевремя типзначения типзначениястр установитьтана установитьтапо фиксшаблон шаблон ';
// v8 методы глобального контекста ==> built_in
var v8_global_context_methods =
'acos asin atan base64значение base64строка cos exp log log10 pow sin sqrt tan xmlзначение xmlстрока ' +
'xmlтип xmlтипзнч активноеокно безопасныйрежим безопасныйрежимразделенияданных булево ввестидату ввестизначение ' +
'ввестистроку ввестичисло возможностьчтенияxml вопрос восстановитьзначение врег выгрузитьжурналрегистрации ' +
'выполнитьобработкуоповещения выполнитьпроверкуправдоступа вычислить год данныеформывзначение дата день деньгода ' +
'деньнедели добавитьмесяц заблокироватьданныедляредактирования заблокироватьработупользователя завершитьработусистемы ' +
'загрузитьвнешнююкомпоненту закрытьсправку записатьjson записатьxml записатьдатуjson записьжурналарегистрации ' +
'заполнитьзначениясвойств запроситьразрешениепользователя запуститьприложение запуститьсистему зафиксироватьтранзакцию ' +
'значениевданныеформы значениевстрокувнутр значениевфайл значениезаполнено значениеизстрокивнутр значениеизфайла ' +
'изxmlтипа импортмоделиxdto имякомпьютера имяпользователя инициализироватьпредопределенныеданные информацияобошибке ' +
'каталогбиблиотекимобильногоустройства каталогвременныхфайлов каталогдокументов каталогпрограммы кодироватьстроку ' +
'кодлокализацииинформационнойбазы кодсимвола командасистемы конецгода конецдня конецквартала конецмесяца конецминуты ' +
'конецнедели конецчаса конфигурациябазыданныхизмененадинамически конфигурацияизменена копироватьданныеформы ' +
'копироватьфайл краткоепредставлениеошибки лев макс местноевремя месяц мин минута монопольныйрежим найти ' +
'найтинедопустимыесимволыxml найтиокнопонавигационнойссылке найтипомеченныенаудаление найтипоссылкам найтифайлы ' +
'началогода началодня началоквартала началомесяца началоминуты началонедели началочаса начатьзапросразрешенияпользователя ' +
'начатьзапускприложения начатькопированиефайла начатьперемещениефайла начатьподключениевнешнейкомпоненты ' +
'начатьподключениерасширенияработыскриптографией начатьподключениерасширенияработысфайлами начатьпоискфайлов ' +
'начатьполучениекаталогавременныхфайлов начатьполучениекаталогадокументов начатьполучениерабочегокаталогаданныхпользователя ' +
'начатьполучениефайлов начатьпомещениефайла начатьпомещениефайлов начатьсозданиедвоичныхданныхизфайла начатьсозданиекаталога ' +
'начатьтранзакцию начатьудалениефайлов начатьустановкувнешнейкомпоненты начатьустановкурасширенияработыскриптографией ' +
'начатьустановкурасширенияработысфайлами неделягода необходимостьзавершениясоединения номерсеансаинформационнойбазы ' +
'номерсоединенияинформационнойбазы нрег нстр обновитьинтерфейс обновитьнумерациюобъектов обновитьповторноиспользуемыезначения ' +
'обработкапрерыванияпользователя объединитьфайлы окр описаниеошибки оповестить оповеститьобизменении ' +
'отключитьобработчикзапросанастроекклиенталицензирования отключитьобработчикожидания отключитьобработчикоповещения ' +
'открытьзначение открытьиндекссправки открытьсодержаниесправки открытьсправку открытьформу открытьформумодально ' +
'отменитьтранзакцию очиститьжурналрегистрации очиститьнастройкипользователя очиститьсообщения параметрыдоступа ' +
'перейтипонавигационнойссылке переместитьфайл подключитьвнешнююкомпоненту ' +
'подключитьобработчикзапросанастроекклиенталицензирования подключитьобработчикожидания подключитьобработчикоповещения ' +
'подключитьрасширениеработыскриптографией подключитьрасширениеработысфайлами подробноепредставлениеошибки ' +
'показатьвводдаты показатьвводзначения показатьвводстроки показатьвводчисла показатьвопрос показатьзначение ' +
'показатьинформациюобошибке показатьнакарте показатьоповещениепользователя показатьпредупреждение полноеимяпользователя ' +
'получитьcomобъект получитьxmlтип получитьадреспоместоположению получитьблокировкусеансов получитьвремязавершенияспящегосеанса ' +
'получитьвремязасыпанияпассивногосеанса получитьвремяожиданияблокировкиданных получитьданныевыбора ' +
'получитьдополнительныйпараметрклиенталицензирования получитьдопустимыекодылокализации получитьдопустимыечасовыепояса ' +
'получитьзаголовокклиентскогоприложения получитьзаголовоксистемы получитьзначенияотборажурналарегистрации ' +
'получитьидентификаторконфигурации получитьизвременногохранилища получитьимявременногофайла ' +
'получитьимяклиенталицензирования получитьинформациюэкрановклиента получитьиспользованиежурналарегистрации ' +
'получитьиспользованиесобытияжурналарегистрации получитькраткийзаголовокприложения получитьмакетоформления ' +
'получитьмаскувсефайлы получитьмаскувсефайлыклиента получитьмаскувсефайлысервера получитьместоположениепоадресу ' +
'получитьминимальнуюдлинупаролейпользователей получитьнавигационнуюссылку получитьнавигационнуюссылкуинформационнойбазы ' +
'получитьобновлениеконфигурациибазыданных получитьобновлениепредопределенныхданныхинформационнойбазы получитьобщиймакет ' +
'получитьобщуюформу получитьокна получитьоперативнуюотметкувремени получитьотключениебезопасногорежима ' +
'получитьпараметрыфункциональныхопцийинтерфейса получитьполноеимяпредопределенногозначения ' +
'получитьпредставлениянавигационныхссылок получитьпроверкусложностипаролейпользователей получитьразделительпути ' +
'получитьразделительпутиклиента получитьразделительпутисервера получитьсеансыинформационнойбазы ' +
'получитьскоростьклиентскогосоединения получитьсоединенияинформационнойбазы получитьсообщенияпользователю ' +
'получитьсоответствиеобъектаиформы получитьсоставстандартногоинтерфейсаodata получитьструктурухранениябазыданных ' +
'получитьтекущийсеансинформационнойбазы получитьфайл получитьфайлы получитьформу получитьфункциональнуюопцию ' +
'получитьфункциональнуюопциюинтерфейса получитьчасовойпоясинформационнойбазы пользователиос поместитьвовременноехранилище ' +
'поместитьфайл поместитьфайлы прав праводоступа предопределенноезначение представлениекодалокализации представлениепериода ' +
'представлениеправа представлениеприложения представлениесобытияжурналарегистрации представлениечасовогопояса предупреждение ' +
'прекратитьработусистемы привилегированныйрежим продолжитьвызов прочитатьjson прочитатьxml прочитатьдатуjson пустаястрока ' +
'рабочийкаталогданныхпользователя разблокироватьданныедляредактирования разделитьфайл разорватьсоединениесвнешнимисточникомданных ' +
'раскодироватьстроку рольдоступна секунда сигнал символ скопироватьжурналрегистрации смещениелетнеговремени ' +
'смещениестандартноговремени соединитьбуферыдвоичныхданных создатькаталог создатьфабрикуxdto сокрл сокрлп сокрп сообщить ' +
'состояние сохранитьзначение сохранитьнастройкипользователя сред стрдлина стрзаканчиваетсяна стрзаменить стрнайти стрначинаетсяс ' +
'строка строкасоединенияинформационнойбазы стрполучитьстроку стрразделить стрсоединить стрсравнить стрчисловхождений '+
'стрчислострок стршаблон текущаядата текущаядатасеанса текущаяуниверсальнаядата текущаяуниверсальнаядатавмиллисекундах ' +
'текущийвариантинтерфейсаклиентскогоприложения текущийвариантосновногошрифтаклиентскогоприложения текущийкодлокализации ' +
'текущийрежимзапуска текущийязык текущийязыксистемы тип типзнч транзакцияактивна трег удалитьданныеинформационнойбазы ' +
'удалитьизвременногохранилища удалитьобъекты удалитьфайлы универсальноевремя установитьбезопасныйрежим ' +
'установитьбезопасныйрежимразделенияданных установитьблокировкусеансов установитьвнешнююкомпоненту ' +
'установитьвремязавершенияспящегосеанса установитьвремязасыпанияпассивногосеанса установитьвремяожиданияблокировкиданных ' +
'установитьзаголовокклиентскогоприложения установитьзаголовоксистемы установитьиспользованиежурналарегистрации ' +
'установитьиспользованиесобытияжурналарегистрации установитькраткийзаголовокприложения ' +
'установитьминимальнуюдлинупаролейпользователей установитьмонопольныйрежим установитьнастройкиклиенталицензирования ' +
'установитьобновлениепредопределенныхданныхинформационнойбазы установитьотключениебезопасногорежима ' +
'установитьпараметрыфункциональныхопцийинтерфейса установитьпривилегированныйрежим ' +
'установитьпроверкусложностипаролейпользователей установитьрасширениеработыскриптографией ' +
'установитьрасширениеработысфайлами установитьсоединениесвнешнимисточникомданных установитьсоответствиеобъектаиформы ' +
'установитьсоставстандартногоинтерфейсаodata установитьчасовойпоясинформационнойбазы установитьчасовойпояссеанса ' +
'формат цел час часовойпояс часовойпояссеанса число числопрописью этоадресвременногохранилища ';
// v8 свойства глобального контекста ==> built_in
var v8_global_context_property =
'wsссылки библиотекакартинок библиотекамакетовоформлениякомпоновкиданных библиотекастилей бизнеспроцессы ' +
'внешниеисточникиданных внешниеобработки внешниеотчеты встроенныепокупки главныйинтерфейс главныйстиль ' +
'документы доставляемыеуведомления журналыдокументов задачи информацияобинтернетсоединении использованиерабочейдаты ' +
'историяработыпользователя константы критерииотбора метаданные обработки отображениерекламы отправкадоставляемыхуведомлений ' +
'отчеты панельзадачос параметрзапуска параметрысеанса перечисления планывидоврасчета планывидовхарактеристик ' +
'планыобмена планысчетов полнотекстовыйпоиск пользователиинформационнойбазы последовательности проверкавстроенныхпокупок ' +
'рабочаядата расширенияконфигурации регистрыбухгалтерии регистрынакопления регистрырасчета регистрысведений ' +
'регламентныезадания сериализаторxdto справочники средствагеопозиционирования средствакриптографии средствамультимедиа ' +
'средстваотображениярекламы средствапочты средствателефонии фабрикаxdto файловыепотоки фоновыезадания хранилищанастроек ' +
'хранилищевариантовотчетов хранилищенастроекданныхформ хранилищеобщихнастроек хранилищепользовательскихнастроекдинамическихсписков ' +
'хранилищепользовательскихнастроекотчетов хранилищесистемныхнастроек ';
// built_in : встроенные или библиотечные объекты (константы, классы, функции)
var BUILTIN =
v7_system_constants +
v7_global_context_methods + v8_global_context_methods +
v8_global_context_property;
// v8 системные наборы значений ==> class
var v8_system_sets_of_values =
'webцвета windowsцвета windowsшрифты библиотекакартинок рамкистиля символы цветастиля шрифтыстиля ';
// v8 системные перечисления - интерфейсные ==> class
var v8_system_enums_interface =
'автоматическоесохранениеданныхформывнастройках автонумерациявформе автораздвижениесерий ' +
'анимациядиаграммы вариантвыравниванияэлементовизаголовков вариантуправлениявысотойтаблицы ' +
'вертикальнаяпрокруткаформы вертикальноеположение вертикальноеположениеэлемента видгруппыформы ' +
'виддекорацииформы виддополненияэлементаформы видизмененияданных видкнопкиформы видпереключателя ' +
'видподписейкдиаграмме видполяформы видфлажка влияниеразмеранапузырекдиаграммы горизонтальноеположение ' +
'горизонтальноеположениеэлемента группировкаколонок группировкаподчиненныхэлементовформы ' +
'группыиэлементы действиеперетаскивания дополнительныйрежимотображения допустимыедействияперетаскивания ' +
'интервалмеждуэлементамиформы использованиевывода использованиеполосыпрокрутки ' +
'используемоезначениеточкибиржевойдиаграммы историявыборапривводе источникзначенийоситочекдиаграммы ' +
'источникзначенияразмерапузырькадиаграммы категориягруппыкоманд максимумсерий начальноеотображениедерева ' +
'начальноеотображениесписка обновлениетекстаредактирования ориентациядендрограммы ориентациядиаграммы ' +
'ориентацияметокдиаграммы ориентацияметоксводнойдиаграммы ориентацияэлементаформы отображениевдиаграмме ' +
'отображениевлегендедиаграммы отображениегруппыкнопок отображениезаголовкашкалыдиаграммы ' +
'отображениезначенийсводнойдиаграммы отображениезначенияизмерительнойдиаграммы ' +
'отображениеинтерваладиаграммыганта отображениекнопки отображениекнопкивыбора отображениеобсужденийформы ' +
'отображениеобычнойгруппы отображениеотрицательныхзначенийпузырьковойдиаграммы отображениепанелипоиска ' +
'отображениеподсказки отображениепредупрежденияприредактировании отображениеразметкиполосырегулирования ' +
'отображениестраницформы отображениетаблицы отображениетекстазначениядиаграммыганта ' +
'отображениеуправленияобычнойгруппы отображениефигурыкнопки палитрацветовдиаграммы поведениеобычнойгруппы ' +
'поддержкамасштабадендрограммы поддержкамасштабадиаграммыганта поддержкамасштабасводнойдиаграммы ' +
'поисквтаблицепривводе положениезаголовкаэлементаформы положениекартинкикнопкиформы ' +
'положениекартинкиэлементаграфическойсхемы положениекоманднойпанелиформы положениекоманднойпанелиэлементаформы ' +
'положениеопорнойточкиотрисовки положениеподписейкдиаграмме положениеподписейшкалызначенийизмерительнойдиаграммы ' +
'положениесостоянияпросмотра положениестрокипоиска положениетекстасоединительнойлинии положениеуправленияпоиском ' +
'положениешкалывремени порядокотображенияточекгоризонтальнойгистограммы порядоксерийвлегендедиаграммы ' +
'размеркартинки расположениезаголовкашкалыдиаграммы растягиваниеповертикалидиаграммыганта ' +
'режимавтоотображениясостояния режимвводастроктаблицы режимвыборанезаполненного режимвыделениядаты ' +
'режимвыделениястрокитаблицы режимвыделениятаблицы режимизмененияразмера режимизменениясвязанногозначения ' +
'режимиспользованиядиалогапечати режимиспользованияпараметракоманды режиммасштабированияпросмотра ' +
'режимосновногоокнаклиентскогоприложения режимоткрытияокнаформы режимотображениявыделения ' +
'режимотображениягеографическойсхемы режимотображениязначенийсерии режимотрисовкисеткиграфическойсхемы ' +
'режимполупрозрачностидиаграммы режимпробеловдиаграммы режимразмещениянастранице режимредактированияколонки ' +
'режимсглаживаниядиаграммы режимсглаживанияиндикатора режимсписказадач сквозноевыравнивание ' +
'сохранениеданныхформывнастройках способзаполнениятекстазаголовкашкалыдиаграммы ' +
'способопределенияограничивающегозначениядиаграммы стандартнаягруппакоманд стандартноеоформление ' +
'статусоповещенияпользователя стильстрелки типаппроксимациилиниитрендадиаграммы типдиаграммы ' +
'типединицышкалывремени типимпортасерийслоягеографическойсхемы типлиниигеографическойсхемы типлиниидиаграммы ' +
'типмаркерагеографическойсхемы типмаркерадиаграммы типобластиоформления ' +
'типорганизацииисточникаданныхгеографическойсхемы типотображениясериислоягеографическойсхемы ' +
'типотображенияточечногообъектагеографическойсхемы типотображенияшкалыэлементалегендыгеографическойсхемы ' +
'типпоискаобъектовгеографическойсхемы типпроекциигеографическойсхемы типразмещенияизмерений ' +
'типразмещенияреквизитовизмерений типрамкиэлементауправления типсводнойдиаграммы ' +
'типсвязидиаграммыганта типсоединениязначенийпосериямдиаграммы типсоединенияточекдиаграммы ' +
'типсоединительнойлинии типстороныэлементаграфическойсхемы типформыотчета типшкалырадарнойдиаграммы ' +
'факторлиниитрендадиаграммы фигуракнопки фигурыграфическойсхемы фиксациявтаблице форматдняшкалывремени ' +
'форматкартинки ширинаподчиненныхэлементовформы ';
// v8 системные перечисления - свойства прикладных объектов ==> class
var v8_system_enums_objects_properties =
'виддвижениябухгалтерии виддвижениянакопления видпериодарегистрарасчета видсчета видточкимаршрутабизнеспроцесса ' +
'использованиеагрегатарегистранакопления использованиегруппиэлементов использованиережимапроведения ' +
'использованиесреза периодичностьагрегатарегистранакопления режимавтовремя режимзаписидокумента режимпроведениядокумента ';
// v8 системные перечисления - планы обмена ==> class
var v8_system_enums_exchange_plans =
'авторегистрацияизменений допустимыйномерсообщения отправкаэлементаданных получениеэлементаданных ';
// v8 системные перечисления - табличный документ ==> class
var v8_system_enums_tabular_document =
'использованиерасшифровкитабличногодокумента ориентациястраницы положениеитоговколоноксводнойтаблицы ' +
'положениеитоговстроксводнойтаблицы положениетекстаотносительнокартинки расположениезаголовкагруппировкитабличногодокумента ' +
'способчтениязначенийтабличногодокумента типдвустороннейпечати типзаполненияобластитабличногодокумента ' +
'типкурсоровтабличногодокумента типлиниирисункатабличногодокумента типлинииячейкитабличногодокумента ' +
'типнаправленияпереходатабличногодокумента типотображениявыделениятабличногодокумента типотображениялинийсводнойтаблицы ' +
'типразмещениятекстатабличногодокумента типрисункатабличногодокумента типсмещениятабличногодокумента ' +
'типузоратабличногодокумента типфайлатабличногодокумента точностьпечати чередованиерасположениястраниц ';
// v8 системные перечисления - планировщик ==> class
var v8_system_enums_sheduler =
'отображениевремениэлементовпланировщика ';
// v8 системные перечисления - форматированный документ ==> class
var v8_system_enums_formatted_document =
'типфайлаформатированногодокумента ';
// v8 системные перечисления - запрос ==> class
var v8_system_enums_query =
'обходрезультатазапроса типзаписизапроса ';
// v8 системные перечисления - построитель отчета ==> class
var v8_system_enums_report_builder =
'видзаполнениярасшифровкипостроителяотчета типдобавленияпредставлений типизмеренияпостроителяотчета типразмещенияитогов ';
// v8 системные перечисления - работа с файлами ==> class
var v8_system_enums_files =
'доступкфайлу режимдиалогавыборафайла режимоткрытияфайла ';
// v8 системные перечисления - построитель запроса ==> class
var v8_system_enums_query_builder =
'типизмеренияпостроителязапроса ';
// v8 системные перечисления - анализ данных ==> class
var v8_system_enums_data_analysis =
'видданныханализа методкластеризации типединицыинтервалавременианализаданных типзаполнениятаблицырезультатаанализаданных ' +
'типиспользованиячисловыхзначенийанализаданных типисточникаданныхпоискаассоциаций типколонкианализаданныхдереворешений ' +
'типколонкианализаданныхкластеризация типколонкианализаданныхобщаястатистика типколонкианализаданныхпоискассоциаций ' +
'типколонкианализаданныхпоискпоследовательностей типколонкимоделипрогноза типмерырасстоянияанализаданных ' +
'типотсеченияправилассоциации типполяанализаданных типстандартизациианализаданных типупорядочиванияправилассоциациианализаданных ' +
'типупорядочиванияшаблоновпоследовательностейанализаданных типупрощениядереварешений ';
// v8 системные перечисления - xml, json, xs, dom, xdto, web-сервисы ==> class
var v8_system_enums_xml_json_xs_dom_xdto_ws =
'wsнаправлениепараметра вариантxpathxs вариантзаписидатыjson вариантпростоготипаxs видгруппымоделиxs видфасетаxdto ' +
'действиепостроителяdom завершенностьпростоготипаxs завершенностьсоставноготипаxs завершенностьсхемыxs запрещенныеподстановкиxs ' +
'исключениягруппподстановкиxs категорияиспользованияатрибутаxs категорияограниченияидентичностиxs категорияограниченияпространствименxs ' +
'методнаследованияxs модельсодержимогоxs назначениетипаxml недопустимыеподстановкиxs обработкапробельныхсимволовxs обработкасодержимогоxs ' +
'ограничениезначенияxs параметрыотбораузловdom переносстрокjson позициявдокументеdom пробельныесимволыxml типатрибутаxml типзначенияjson ' +
'типканоническогоxml типкомпонентыxs типпроверкиxml типрезультатаdomxpath типузлаdom типузлаxml формаxml формапредставленияxs ' +
'форматдатыjson экранированиесимволовjson ';
// v8 системные перечисления - система компоновки данных ==> class
var v8_system_enums_data_composition_system =
'видсравнениякомпоновкиданных действиеобработкирасшифровкикомпоновкиданных направлениесортировкикомпоновкиданных ' +
'расположениевложенныхэлементоврезультатакомпоновкиданных расположениеитоговкомпоновкиданных расположениегруппировкикомпоновкиданных ' +
'расположениеполейгруппировкикомпоновкиданных расположениеполякомпоновкиданных расположениереквизитовкомпоновкиданных ' +
'расположениересурсовкомпоновкиданных типбухгалтерскогоостаткакомпоновкиданных типвыводатекстакомпоновкиданных ' +
'типгруппировкикомпоновкиданных типгруппыэлементовотборакомпоновкиданных типдополненияпериодакомпоновкиданных ' +
'типзаголовкаполейкомпоновкиданных типмакетагруппировкикомпоновкиданных типмакетаобластикомпоновкиданных типостаткакомпоновкиданных ' +
'типпериодакомпоновкиданных типразмещениятекстакомпоновкиданных типсвязинаборовданныхкомпоновкиданных типэлементарезультатакомпоновкиданных ' +
'расположениелегендыдиаграммыкомпоновкиданных типпримененияотборакомпоновкиданных режимотображенияэлементанастройкикомпоновкиданных ' +
'режимотображениянастроеккомпоновкиданных состояниеэлементанастройкикомпоновкиданных способвосстановлениянастроеккомпоновкиданных ' +
'режимкомпоновкирезультата использованиепараметракомпоновкиданных автопозицияресурсовкомпоновкиданных '+
'вариантиспользованиягруппировкикомпоновкиданных расположениересурсоввдиаграммекомпоновкиданных фиксациякомпоновкиданных ' +
'использованиеусловногооформлениякомпоновкиданных ';
// v8 системные перечисления - почта ==> class
var v8_system_enums_email =
'важностьинтернетпочтовогосообщения обработкатекстаинтернетпочтовогосообщения способкодированияинтернетпочтовоговложения ' +
'способкодированиянеasciiсимволовинтернетпочтовогосообщения типтекстапочтовогосообщения протоколинтернетпочты ' +
'статусразборапочтовогосообщения ';
// v8 системные перечисления - журнал регистрации ==> class
var v8_system_enums_logbook =
'режимтранзакциизаписижурналарегистрации статустранзакциизаписижурналарегистрации уровеньжурналарегистрации ';
// v8 системные перечисления - криптография ==> class
var v8_system_enums_cryptography =
'расположениехранилищасертификатовкриптографии режимвключениясертификатовкриптографии режимпроверкисертификатакриптографии ' +
'типхранилищасертификатовкриптографии ';
// v8 системные перечисления - ZIP ==> class
var v8_system_enums_zip =
'кодировкаименфайловвzipфайле методсжатияzip методшифрованияzip режимвосстановленияпутейфайловzip режимобработкиподкаталоговzip ' +
'режимсохраненияпутейzip уровеньсжатияzip ';
// v8 системные перечисления -
// Блокировка данных, Фоновые задания, Автоматизированное тестирование,
// Доставляемые уведомления, Встроенные покупки, Интернет, Работа с двоичными данными ==> class
var v8_system_enums_other =
'звуковоеоповещение направлениепереходакстроке позициявпотоке порядокбайтов режимблокировкиданных режимуправленияблокировкойданных ' +
'сервисвстроенныхпокупок состояниефоновогозадания типподписчикадоставляемыхуведомлений уровеньиспользованиязащищенногосоединенияftp ';
// v8 системные перечисления - схема запроса ==> class
var v8_system_enums_request_schema =
'направлениепорядкасхемызапроса типдополненияпериодамисхемызапроса типконтрольнойточкисхемызапроса типобъединениясхемызапроса ' +
'типпараметрадоступнойтаблицысхемызапроса типсоединениясхемызапроса ';
// v8 системные перечисления - свойства объектов метаданных ==> class
var v8_system_enums_properties_of_metadata_objects =
'httpметод автоиспользованиеобщегореквизита автопрефиксномеразадачи вариантвстроенногоязыка видиерархии видрегистранакопления ' +
'видтаблицывнешнегоисточникаданных записьдвиженийприпроведении заполнениепоследовательностей индексирование ' +
'использованиебазыпланавидоврасчета использованиебыстроговыбора использованиеобщегореквизита использованиеподчинения ' +
'использованиеполнотекстовогопоиска использованиеразделяемыхданныхобщегореквизита использованиереквизита ' +
'назначениеиспользованияприложения назначениерасширенияконфигурации направлениепередачи обновлениепредопределенныхданных ' +
'оперативноепроведение основноепредставлениевидарасчета основноепредставлениевидахарактеристики основноепредставлениезадачи ' +
'основноепредставлениепланаобмена основноепредставлениесправочника основноепредставлениесчета перемещениеграницыприпроведении ' +
'периодичностьномерабизнеспроцесса периодичностьномерадокумента периодичностьрегистрарасчета периодичностьрегистрасведений ' +
'повторноеиспользованиевозвращаемыхзначений полнотекстовыйпоискпривводепостроке принадлежностьобъекта проведение ' +
'разделениеаутентификацииобщегореквизита разделениеданныхобщегореквизита разделениерасширенийконфигурацииобщегореквизита '+
'режимавтонумерацииобъектов режимзаписирегистра режимиспользованиямодальности ' +
'режимиспользованиясинхронныхвызововрасширенийплатформыивнешнихкомпонент режимповторногоиспользованиясеансов ' +
'режимполученияданныхвыборапривводепостроке режимсовместимости режимсовместимостиинтерфейса ' +
'режимуправленияблокировкойданныхпоумолчанию сериикодовпланавидовхарактеристик сериикодовпланасчетов ' +
'сериикодовсправочника созданиепривводе способвыбора способпоискастрокипривводепостроке способредактирования ' +
'типданныхтаблицывнешнегоисточникаданных типкодапланавидоврасчета типкодасправочника типмакета типномерабизнеспроцесса ' +
'типномерадокумента типномеразадачи типформы удалениедвижений ';
// v8 системные перечисления - разные ==> class
var v8_system_enums_differents =
'важностьпроблемыприменениярасширенияконфигурации вариантинтерфейсаклиентскогоприложения вариантмасштабаформклиентскогоприложения ' +
'вариантосновногошрифтаклиентскогоприложения вариантстандартногопериода вариантстандартнойдатыначала видграницы видкартинки ' +
'видотображенияполнотекстовогопоиска видрамки видсравнения видцвета видчисловогозначения видшрифта допустимаядлина допустимыйзнак ' +
'использованиеbyteordermark использованиеметаданныхполнотекстовогопоиска источникрасширенийконфигурации клавиша кодвозвратадиалога ' +
'кодировкаxbase кодировкатекста направлениепоиска направлениесортировки обновлениепредопределенныхданных обновлениеприизмененииданных ' +
'отображениепанелиразделов проверказаполнения режимдиалогавопрос режимзапускаклиентскогоприложения режимокругления режимоткрытияформприложения ' +
'режимполнотекстовогопоиска скоростьклиентскогосоединения состояниевнешнегоисточникаданных состояниеобновленияконфигурациибазыданных ' +
'способвыборасертификатаwindows способкодированиястроки статуссообщения типвнешнейкомпоненты типплатформы типповеденияклавишиenter ' +
'типэлементаинформацииовыполненииобновленияконфигурациибазыданных уровеньизоляциитранзакций хешфункция частидаты';
// class: встроенные наборы значений, системные перечисления (содержат дочерние значения, обращения к которым через разыменование)
var CLASS =
v8_system_sets_of_values +
v8_system_enums_interface +
v8_system_enums_objects_properties +
v8_system_enums_exchange_plans +
v8_system_enums_tabular_document +
v8_system_enums_sheduler +
v8_system_enums_formatted_document +
v8_system_enums_query +
v8_system_enums_report_builder +
v8_system_enums_files +
v8_system_enums_query_builder +
v8_system_enums_data_analysis +
v8_system_enums_xml_json_xs_dom_xdto_ws +
v8_system_enums_data_composition_system +
v8_system_enums_email +
v8_system_enums_logbook +
v8_system_enums_cryptography +
v8_system_enums_zip +
v8_system_enums_other +
v8_system_enums_request_schema +
v8_system_enums_properties_of_metadata_objects +
v8_system_enums_differents;
// v8 общие объекты (у объектов есть конструктор, экземпляры создаются методом НОВЫЙ) ==> type
var v8_shared_object =
'comобъект ftpсоединение httpзапрос httpсервисответ httpсоединение wsопределения wsпрокси xbase анализданных аннотацияxs ' +
'блокировкаданных буфердвоичныхданных включениеxs выражениекомпоновкиданных генераторслучайныхчисел географическаясхема ' +
'географическиекоординаты графическаясхема группамоделиxs данныерасшифровкикомпоновкиданных двоичныеданные дендрограмма ' +
'диаграмма диаграммаганта диалогвыборафайла диалогвыборацвета диалогвыборашрифта диалограсписаниярегламентногозадания ' +
'диалогредактированиястандартногопериода диапазон документdom документhtml документацияxs доставляемоеуведомление ' +
'записьdom записьfastinfoset записьhtml записьjson записьxml записьzipфайла записьданных записьтекста записьузловdom ' +
'запрос защищенноесоединениеopenssl значенияполейрасшифровкикомпоновкиданных извлечениетекста импортxs интернетпочта ' +
'интернетпочтовоесообщение интернетпочтовыйпрофиль интернетпрокси интернетсоединение информациядляприложенияxs ' +
'использованиеатрибутаxs использованиесобытияжурналарегистрации источникдоступныхнастроеккомпоновкиданных ' +
'итераторузловdom картинка квалификаторыдаты квалификаторыдвоичныхданных квалификаторыстроки квалификаторычисла ' +
'компоновщикмакетакомпоновкиданных компоновщикнастроеккомпоновкиданных конструктормакетаоформлениякомпоновкиданных ' +
'конструкторнастроеккомпоновкиданных конструкторформатнойстроки линия макеткомпоновкиданных макетобластикомпоновкиданных ' +
'макетоформлениякомпоновкиданных маскаxs менеджеркриптографии наборсхемxml настройкикомпоновкиданных настройкисериализацииjson ' +
'обработкакартинок обработкарасшифровкикомпоновкиданных обходдереваdom объявлениеатрибутаxs объявлениенотацииxs ' +
'объявлениеэлементаxs описаниеиспользованиясобытиядоступжурналарегистрации ' +
'описаниеиспользованиясобытияотказвдоступежурналарегистрации описаниеобработкирасшифровкикомпоновкиданных ' +
'описаниепередаваемогофайла описаниетипов определениегруппыатрибутовxs определениегруппымоделиxs ' +
'определениеограниченияидентичностиxs определениепростоготипаxs определениесоставноготипаxs определениетипадокументаdom ' +
'определенияxpathxs отборкомпоновкиданных пакетотображаемыхдокументов параметрвыбора параметркомпоновкиданных ' +
'параметрызаписиjson параметрызаписиxml параметрычтенияxml переопределениеxs планировщик полеанализаданных ' +
'полекомпоновкиданных построительdom построительзапроса построительотчета построительотчетаанализаданных ' +
'построительсхемxml поток потоквпамяти почта почтовоесообщение преобразованиеxsl преобразованиекканоническомуxml ' +
'процессорвыводарезультатакомпоновкиданныхвколлекциюзначений процессорвыводарезультатакомпоновкиданныхвтабличныйдокумент ' +
'процессоркомпоновкиданных разыменовательпространствименdom рамка расписаниерегламентногозадания расширенноеимяxml ' +
'результатчтенияданных своднаядиаграмма связьпараметравыбора связьпотипу связьпотипукомпоновкиданных сериализаторxdto ' +
'сертификатклиентаwindows сертификатклиентафайл сертификаткриптографии сертификатыудостоверяющихцентровwindows ' +
'сертификатыудостоверяющихцентровфайл сжатиеданных системнаяинформация сообщениепользователю сочетаниеклавиш ' +
'сравнениезначений стандартнаядатаначала стандартныйпериод схемаxml схемакомпоновкиданных табличныйдокумент ' +
'текстовыйдокумент тестируемоеприложение типданныхxml уникальныйидентификатор фабрикаxdto файл файловыйпоток ' +
'фасетдлиныxs фасетколичестваразрядовдробнойчастиxs фасетмаксимальноговключающегозначенияxs ' +
'фасетмаксимальногоисключающегозначенияxs фасетмаксимальнойдлиныxs фасетминимальноговключающегозначенияxs ' +
'фасетминимальногоисключающегозначенияxs фасетминимальнойдлиныxs фасетобразцаxs фасетобщегоколичестваразрядовxs ' +
'фасетперечисленияxs фасетпробельныхсимволовxs фильтрузловdom форматированнаястрока форматированныйдокумент ' +
'фрагментxs хешированиеданных хранилищезначения цвет чтениеfastinfoset чтениеhtml чтениеjson чтениеxml чтениеzipфайла ' +
'чтениеданных чтениетекста чтениеузловdom шрифт элементрезультатакомпоновкиданных ';
// v8 универсальные коллекции значений ==> type
var v8_universal_collection =
'comsafearray деревозначений массив соответствие списокзначений структура таблицазначений фиксированнаяструктура ' +
'фиксированноесоответствие фиксированныймассив ';
// type : встроенные типы
var TYPE =
v8_shared_object +
v8_universal_collection;
// literal : примитивные типы
var LITERAL = 'null истина ложь неопределено';
// number : числа
var NUMBERS = hljs.inherit(hljs.NUMBER_MODE);
// string : строки
var STRINGS = {
className: 'string',
begin: '"|\\|', end: '"|$',
contains: [{begin: '""'}]
};
// number : даты
var DATE = {
begin: "'", end: "'", excludeBegin: true, excludeEnd: true,
contains: [
{
className: 'number',
begin: '\\d{4}([\\.\\\\/:-]?\\d{2}){0,5}'
}
]
};
// comment : комментарии
var COMMENTS = hljs.inherit(hljs.C_LINE_COMMENT_MODE);
// meta : инструкции препроцессора, директивы компиляции
var META = {
className: 'meta',
begin: '#|&', end: '$',
keywords: {
$pattern: UNDERSCORE_IDENT_RE,
keyword: KEYWORD + METAKEYWORD
},
contains: [
COMMENTS
]
};
// symbol : метка goto
var SYMBOL = {
className: 'symbol',
begin: '~', end: ';|:', excludeEnd: true
};
// function : объявление процедур и функций
var FUNCTION = {
className: 'function',
variants: [
{begin: 'процедура|функция', end: '\\)', keywords: 'процедура функция'},
{begin: 'конецпроцедуры|конецфункции', keywords: 'конецпроцедуры конецфункции'}
],
contains: [
{
begin: '\\(', end: '\\)', endsParent : true,
contains: [
{
className: 'params',
begin: UNDERSCORE_IDENT_RE, end: ',', excludeEnd: true, endsWithParent: true,
keywords: {
$pattern: UNDERSCORE_IDENT_RE,
keyword: 'знач',
literal: LITERAL
},
contains: [
NUMBERS,
STRINGS,
DATE
]
},
COMMENTS
]
},
hljs.inherit(hljs.TITLE_MODE, {begin: UNDERSCORE_IDENT_RE})
]
};
return {
name: '1C:Enterprise',
case_insensitive: true,
keywords: {
$pattern: UNDERSCORE_IDENT_RE,
keyword: KEYWORD,
built_in: BUILTIN,
class: CLASS,
type: TYPE,
literal: LITERAL
},
contains: [
META,
FUNCTION,
COMMENTS,
SYMBOL,
NUMBERS,
STRINGS,
DATE
]
};
}
module.exports = _1c;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/abnf.js":
/*!*********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/abnf.js ***!
\*********************************************************/
/***/ ((module) => {
/*
Language: Augmented Backus-Naur Form
Author: Alex McKibben
Website: https://tools.ietf.org/html/rfc5234
Audit: 2020
*/
/** @type LanguageFn */
function abnf(hljs) {
const regex = hljs.regex;
const IDENT = /^[a-zA-Z][a-zA-Z0-9-]*/;
const KEYWORDS = [
"ALPHA",
"BIT",
"CHAR",
"CR",
"CRLF",
"CTL",
"DIGIT",
"DQUOTE",
"HEXDIG",
"HTAB",
"LF",
"LWSP",
"OCTET",
"SP",
"VCHAR",
"WSP"
];
const COMMENT = hljs.COMMENT(/;/, /$/);
const TERMINAL_BINARY = {
scope: "symbol",
match: /%b[0-1]+(-[0-1]+|(\.[0-1]+)+)?/
};
const TERMINAL_DECIMAL = {
scope: "symbol",
match: /%d[0-9]+(-[0-9]+|(\.[0-9]+)+)?/
};
const TERMINAL_HEXADECIMAL = {
scope: "symbol",
match: /%x[0-9A-F]+(-[0-9A-F]+|(\.[0-9A-F]+)+)?/
};
const CASE_SENSITIVITY = {
scope: "symbol",
match: /%[si](?=".*")/
};
const RULE_DECLARATION = {
scope: "attribute",
match: regex.concat(IDENT, /(?=\s*=)/)
};
const ASSIGNMENT = {
scope: "operator",
match: /=\/?/
};
return {
name: 'Augmented Backus-Naur Form',
illegal: /[!@#$^&',?+~`|:]/,
keywords: KEYWORDS,
contains: [
ASSIGNMENT,
RULE_DECLARATION,
COMMENT,
TERMINAL_BINARY,
TERMINAL_DECIMAL,
TERMINAL_HEXADECIMAL,
CASE_SENSITIVITY,
hljs.QUOTE_STRING_MODE,
hljs.NUMBER_MODE
]
};
}
module.exports = abnf;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/accesslog.js":
/*!**************************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/accesslog.js ***!
\**************************************************************/
/***/ ((module) => {
/*
Language: Apache Access Log
Author: Oleg Efimov
Description: Apache/Nginx Access Logs
Website: https://httpd.apache.org/docs/2.4/logs.html#accesslog
Category: web, logs
Audit: 2020
*/
/** @type LanguageFn */
function accesslog(hljs) {
const regex = hljs.regex;
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods
const HTTP_VERBS = [
"GET",
"POST",
"HEAD",
"PUT",
"DELETE",
"CONNECT",
"OPTIONS",
"PATCH",
"TRACE"
];
return {
name: 'Apache Access Log',
contains: [
// IP
{
className: 'number',
begin: /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(:\d{1,5})?\b/,
relevance: 5
},
// Other numbers
{
className: 'number',
begin: /\b\d+\b/,
relevance: 0
},
// Requests
{
className: 'string',
begin: regex.concat(/"/, regex.either(...HTTP_VERBS)),
end: /"/,
keywords: HTTP_VERBS,
illegal: /\n/,
relevance: 5,
contains: [
{
begin: /HTTP\/[12]\.\d'/,
relevance: 5
}
]
},
// Dates
{
className: 'string',
// dates must have a certain length, this prevents matching
// simple array accesses a[123] and [] and other common patterns
// found in other languages
begin: /\[\d[^\]\n]{8,}\]/,
illegal: /\n/,
relevance: 1
},
{
className: 'string',
begin: /\[/,
end: /\]/,
illegal: /\n/,
relevance: 0
},
// User agent / relevance boost
{
className: 'string',
begin: /"Mozilla\/\d\.\d \(/,
end: /"/,
illegal: /\n/,
relevance: 3
},
// Strings
{
className: 'string',
begin: /"/,
end: /"/,
illegal: /\n/,
relevance: 0
}
]
};
}
module.exports = accesslog;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/actionscript.js":
/*!*****************************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/actionscript.js ***!
\*****************************************************************/
/***/ ((module) => {
/*
Language: ActionScript
Author: Alexander Myadzel
Category: scripting
Audit: 2020
*/
/** @type LanguageFn */
function actionscript(hljs) {
const regex = hljs.regex;
const IDENT_RE = /[a-zA-Z_$][a-zA-Z0-9_$]*/;
const PKG_NAME_RE = regex.concat(
IDENT_RE,
regex.concat("(\\.", IDENT_RE, ")*")
);
const IDENT_FUNC_RETURN_TYPE_RE = /([*]|[a-zA-Z_$][a-zA-Z0-9_$]*)/;
const AS3_REST_ARG_MODE = {
className: 'rest_arg',
begin: /[.]{3}/,
end: IDENT_RE,
relevance: 10
};
const KEYWORDS = [
"as",
"break",
"case",
"catch",
"class",
"const",
"continue",
"default",
"delete",
"do",
"dynamic",
"each",
"else",
"extends",
"final",
"finally",
"for",
"function",
"get",
"if",
"implements",
"import",
"in",
"include",
"instanceof",
"interface",
"internal",
"is",
"namespace",
"native",
"new",
"override",
"package",
"private",
"protected",
"public",
"return",
"set",
"static",
"super",
"switch",
"this",
"throw",
"try",
"typeof",
"use",
"var",
"void",
"while",
"with"
];
const LITERALS = [
"true",
"false",
"null",
"undefined"
];
return {
name: 'ActionScript',
aliases: [ 'as' ],
keywords: {
keyword: KEYWORDS,
literal: LITERALS
},
contains: [
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE,
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
hljs.C_NUMBER_MODE,
{
match: [
/\bpackage/,
/\s+/,
PKG_NAME_RE
],
className: {
1: "keyword",
3: "title.class"
}
},
{
match: [
/\b(?:class|interface|extends|implements)/,
/\s+/,
IDENT_RE
],
className: {
1: "keyword",
3: "title.class"
}
},
{
className: 'meta',
beginKeywords: 'import include',
end: /;/,
keywords: { keyword: 'import include' }
},
{
beginKeywords: 'function',
end: /[{;]/,
excludeEnd: true,
illegal: /\S/,
contains: [
hljs.inherit(hljs.TITLE_MODE, { className: "title.function" }),
{
className: 'params',
begin: /\(/,
end: /\)/,
contains: [
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE,
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
AS3_REST_ARG_MODE
]
},
{ begin: regex.concat(/:\s*/, IDENT_FUNC_RETURN_TYPE_RE) }
]
},
hljs.METHOD_GUARD
],
illegal: /#/
};
}
module.exports = actionscript;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/ada.js":
/*!********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/ada.js ***!
\********************************************************/
/***/ ((module) => {
/*
Language: Ada
Author: Lars Schulna
Description: Ada is a general-purpose programming language that has great support for saftey critical and real-time applications.
It has been developed by the DoD and thus has been used in military and safety-critical applications (like civil aviation).
The first version appeared in the 80s, but it's still actively developed today with
the newest standard being Ada2012.
*/
// We try to support full Ada2012
//
// We highlight all appearances of types, keywords, literals (string, char, number, bool)
// and titles (user defined function/procedure/package)
// CSS classes are set accordingly
//
// Languages causing problems for language detection:
// xml (broken by Foo : Bar type), elm (broken by Foo : Bar type), vbscript-html (broken by body keyword)
// sql (ada default.txt has a lot of sql keywords)
/** @type LanguageFn */
function ada(hljs) {
// Regular expression for Ada numeric literals.
// stolen form the VHDL highlighter
// Decimal literal:
const INTEGER_RE = '\\d(_|\\d)*';
const EXPONENT_RE = '[eE][-+]?' + INTEGER_RE;
const DECIMAL_LITERAL_RE = INTEGER_RE + '(\\.' + INTEGER_RE + ')?' + '(' + EXPONENT_RE + ')?';
// Based literal:
const BASED_INTEGER_RE = '\\w+';
const BASED_LITERAL_RE = INTEGER_RE + '#' + BASED_INTEGER_RE + '(\\.' + BASED_INTEGER_RE + ')?' + '#' + '(' + EXPONENT_RE + ')?';
const NUMBER_RE = '\\b(' + BASED_LITERAL_RE + '|' + DECIMAL_LITERAL_RE + ')';
// Identifier regex
const ID_REGEX = '[A-Za-z](_?[A-Za-z0-9.])*';
// bad chars, only allowed in literals
const BAD_CHARS = `[]\\{\\}%#'"`;
// Ada doesn't have block comments, only line comments
const COMMENTS = hljs.COMMENT('--', '$');
// variable declarations of the form
// Foo : Bar := Baz;
// where only Bar will be highlighted
const VAR_DECLS = {
// TODO: These spaces are not required by the Ada syntax
// however, I have yet to see handwritten Ada code where
// someone does not put spaces around :
begin: '\\s+:\\s+',
end: '\\s*(:=|;|\\)|=>|$)',
// endsWithParent: true,
// returnBegin: true,
illegal: BAD_CHARS,
contains: [
{
// workaround to avoid highlighting
// named loops and declare blocks
beginKeywords: 'loop for declare others',
endsParent: true
},
{
// properly highlight all modifiers
className: 'keyword',
beginKeywords: 'not null constant access function procedure in out aliased exception'
},
{
className: 'type',
begin: ID_REGEX,
endsParent: true,
relevance: 0
}
]
};
const KEYWORDS = [
"abort",
"else",
"new",
"return",
"abs",
"elsif",
"not",
"reverse",
"abstract",
"end",
"accept",
"entry",
"select",
"access",
"exception",
"of",
"separate",
"aliased",
"exit",
"or",
"some",
"all",
"others",
"subtype",
"and",
"for",
"out",
"synchronized",
"array",
"function",
"overriding",
"at",
"tagged",
"generic",
"package",
"task",
"begin",
"goto",
"pragma",
"terminate",
"body",
"private",
"then",
"if",
"procedure",
"type",
"case",
"in",
"protected",
"constant",
"interface",
"is",
"raise",
"use",
"declare",
"range",
"delay",
"limited",
"record",
"when",
"delta",
"loop",
"rem",
"while",
"digits",
"renames",
"with",
"do",
"mod",
"requeue",
"xor"
];
return {
name: 'Ada',
case_insensitive: true,
keywords: {
keyword: KEYWORDS,
literal: [
"True",
"False"
]
},
contains: [
COMMENTS,
// strings "foobar"
{
className: 'string',
begin: /"/,
end: /"/,
contains: [{
begin: /""/,
relevance: 0
}]
},
// characters ''
{
// character literals always contain one char
className: 'string',
begin: /'.'/
},
{
// number literals
className: 'number',
begin: NUMBER_RE,
relevance: 0
},
{
// Attributes
className: 'symbol',
begin: "'" + ID_REGEX
},
{
// package definition, maybe inside generic
className: 'title',
begin: '(\\bwith\\s+)?(\\bprivate\\s+)?\\bpackage\\s+(\\bbody\\s+)?',
end: '(is|$)',
keywords: 'package body',
excludeBegin: true,
excludeEnd: true,
illegal: BAD_CHARS
},
{
// function/procedure declaration/definition
// maybe inside generic
begin: '(\\b(with|overriding)\\s+)?\\b(function|procedure)\\s+',
end: '(\\bis|\\bwith|\\brenames|\\)\\s*;)',
keywords: 'overriding function procedure with is renames return',
// we need to re-match the 'function' keyword, so that
// the title mode below matches only exactly once
returnBegin: true,
contains:
[
COMMENTS,
{
// name of the function/procedure
className: 'title',
begin: '(\\bwith\\s+)?\\b(function|procedure)\\s+',
end: '(\\(|\\s+|$)',
excludeBegin: true,
excludeEnd: true,
illegal: BAD_CHARS
},
// 'self'
// // parameter types
VAR_DECLS,
{
// return type
className: 'type',
begin: '\\breturn\\s+',
end: '(\\s+|;|$)',
keywords: 'return',
excludeBegin: true,
excludeEnd: true,
// we are done with functions
endsParent: true,
illegal: BAD_CHARS
}
]
},
{
// new type declarations
// maybe inside generic
className: 'type',
begin: '\\b(sub)?type\\s+',
end: '\\s+',
keywords: 'type',
excludeBegin: true,
illegal: BAD_CHARS
},
// see comment above the definition
VAR_DECLS
// no markup
// relevance boosters for small snippets
// {begin: '\\s*=>\\s*'},
// {begin: '\\s*:=\\s*'},
// {begin: '\\s+:=\\s+'},
]
};
}
module.exports = ada;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/angelscript.js":
/*!****************************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/angelscript.js ***!
\****************************************************************/
/***/ ((module) => {
/*
Language: AngelScript
Author: Melissa Geels
Category: scripting
Website: https://www.angelcode.com/angelscript/
*/
/** @type LanguageFn */
function angelscript(hljs) {
const builtInTypeMode = {
className: 'built_in',
begin: '\\b(void|bool|int|int8|int16|int32|int64|uint|uint8|uint16|uint32|uint64|string|ref|array|double|float|auto|dictionary)'
};
const objectHandleMode = {
className: 'symbol',
begin: '[a-zA-Z0-9_]+@'
};
const genericMode = {
className: 'keyword',
begin: '<',
end: '>',
contains: [
builtInTypeMode,
objectHandleMode
]
};
builtInTypeMode.contains = [ genericMode ];
objectHandleMode.contains = [ genericMode ];
const KEYWORDS = [
"for",
"in|0",
"break",
"continue",
"while",
"do|0",
"return",
"if",
"else",
"case",
"switch",
"namespace",
"is",
"cast",
"or",
"and",
"xor",
"not",
"get|0",
"in",
"inout|10",
"out",
"override",
"set|0",
"private",
"public",
"const",
"default|0",
"final",
"shared",
"external",
"mixin|10",
"enum",
"typedef",
"funcdef",
"this",
"super",
"import",
"from",
"interface",
"abstract|0",
"try",
"catch",
"protected",
"explicit",
"property"
];
return {
name: 'AngelScript',
aliases: [ 'asc' ],
keywords: KEYWORDS,
// avoid close detection with C# and JS
illegal: '(^using\\s+[A-Za-z0-9_\\.]+;$|\\bfunction\\s*[^\\(])',
contains: [
{ // 'strings'
className: 'string',
begin: '\'',
end: '\'',
illegal: '\\n',
contains: [ hljs.BACKSLASH_ESCAPE ],
relevance: 0
},
// """heredoc strings"""
{
className: 'string',
begin: '"""',
end: '"""'
},
{ // "strings"
className: 'string',
begin: '"',
end: '"',
illegal: '\\n',
contains: [ hljs.BACKSLASH_ESCAPE ],
relevance: 0
},
hljs.C_LINE_COMMENT_MODE, // single-line comments
hljs.C_BLOCK_COMMENT_MODE, // comment blocks
{ // metadata
className: 'string',
begin: '^\\s*\\[',
end: '\\]'
},
{ // interface or namespace declaration
beginKeywords: 'interface namespace',
end: /\{/,
illegal: '[;.\\-]',
contains: [
{ // interface or namespace name
className: 'symbol',
begin: '[a-zA-Z0-9_]+'
}
]
},
{ // class declaration
beginKeywords: 'class',
end: /\{/,
illegal: '[;.\\-]',
contains: [
{ // class name
className: 'symbol',
begin: '[a-zA-Z0-9_]+',
contains: [
{
begin: '[:,]\\s*',
contains: [
{
className: 'symbol',
begin: '[a-zA-Z0-9_]+'
}
]
}
]
}
]
},
builtInTypeMode, // built-in types
objectHandleMode, // object handles
{ // literals
className: 'literal',
begin: '\\b(null|true|false)'
},
{ // numbers
className: 'number',
relevance: 0,
begin: '(-?)(\\b0[xXbBoOdD][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?f?|\\.\\d+f?)([eE][-+]?\\d+f?)?)'
}
]
};
}
module.exports = angelscript;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/apache.js":
/*!***********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/apache.js ***!
\***********************************************************/
/***/ ((module) => {
/*
Language: Apache config
Author: Ruslan Keba
Contributors: Ivan Sagalaev
Website: https://httpd.apache.org
Description: language definition for Apache configuration files (httpd.conf & .htaccess)
Category: config, web
Audit: 2020
*/
/** @type LanguageFn */
function apache(hljs) {
const NUMBER_REF = {
className: 'number',
begin: /[$%]\d+/
};
const NUMBER = {
className: 'number',
begin: /\b\d+/
};
const IP_ADDRESS = {
className: "number",
begin: /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(:\d{1,5})?/
};
const PORT_NUMBER = {
className: "number",
begin: /:\d{1,5}/
};
return {
name: 'Apache config',
aliases: [ 'apacheconf' ],
case_insensitive: true,
contains: [
hljs.HASH_COMMENT_MODE,
{
className: 'section',
begin: /<\/?/,
end: />/,
contains: [
IP_ADDRESS,
PORT_NUMBER,
// low relevance prevents us from claming XML/HTML where this rule would
// match strings inside of XML tags
hljs.inherit(hljs.QUOTE_STRING_MODE, { relevance: 0 })
]
},
{
className: 'attribute',
begin: /\w+/,
relevance: 0,
// keywords aren’t needed for highlighting per se, they only boost relevance
// for a very generally defined mode (starts with a word, ends with line-end
keywords: {
_: [
"order",
"deny",
"allow",
"setenv",
"rewriterule",
"rewriteengine",
"rewritecond",
"documentroot",
"sethandler",
"errordocument",
"loadmodule",
"options",
"header",
"listen",
"serverroot",
"servername"
]
},
starts: {
end: /$/,
relevance: 0,
keywords: { literal: 'on off all deny allow' },
contains: [
{
className: 'meta',
begin: /\s\[/,
end: /\]$/
},
{
className: 'variable',
begin: /[\$%]\{/,
end: /\}/,
contains: [
'self',
NUMBER_REF
]
},
IP_ADDRESS,
NUMBER,
hljs.QUOTE_STRING_MODE
]
}
}
],
illegal: /\S/
};
}
module.exports = apache;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/applescript.js":
/*!****************************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/applescript.js ***!
\****************************************************************/
/***/ ((module) => {
/*
Language: AppleScript
Authors: Nathan Grigg , Dr. Drang
Category: scripting
Website: https://developer.apple.com/library/archive/documentation/AppleScript/Conceptual/AppleScriptLangGuide/introduction/ASLR_intro.html
Audit: 2020
*/
/** @type LanguageFn */
function applescript(hljs) {
const regex = hljs.regex;
const STRING = hljs.inherit(
hljs.QUOTE_STRING_MODE, {
illegal: null
});
const PARAMS = {
className: 'params',
begin: /\(/,
end: /\)/,
contains: [
'self',
hljs.C_NUMBER_MODE,
STRING
]
};
const COMMENT_MODE_1 = hljs.COMMENT(/--/, /$/);
const COMMENT_MODE_2 = hljs.COMMENT(
/\(\*/,
/\*\)/,
{
contains: [
'self', // allow nesting
COMMENT_MODE_1
]
}
);
const COMMENTS = [
COMMENT_MODE_1,
COMMENT_MODE_2,
hljs.HASH_COMMENT_MODE
];
const KEYWORD_PATTERNS = [
/apart from/,
/aside from/,
/instead of/,
/out of/,
/greater than/,
/isn't|(doesn't|does not) (equal|come before|come after|contain)/,
/(greater|less) than( or equal)?/,
/(starts?|ends|begins?) with/,
/contained by/,
/comes (before|after)/,
/a (ref|reference)/,
/POSIX (file|path)/,
/(date|time) string/,
/quoted form/
];
const BUILT_IN_PATTERNS = [
/clipboard info/,
/the clipboard/,
/info for/,
/list (disks|folder)/,
/mount volume/,
/path to/,
/(close|open for) access/,
/(get|set) eof/,
/current date/,
/do shell script/,
/get volume settings/,
/random number/,
/set volume/,
/system attribute/,
/system info/,
/time to GMT/,
/(load|run|store) script/,
/scripting components/,
/ASCII (character|number)/,
/localized string/,
/choose (application|color|file|file name|folder|from list|remote application|URL)/,
/display (alert|dialog)/
];
return {
name: 'AppleScript',
aliases: [ 'osascript' ],
keywords: {
keyword:
'about above after against and around as at back before beginning ' +
'behind below beneath beside between but by considering ' +
'contain contains continue copy div does eighth else end equal ' +
'equals error every exit fifth first for fourth from front ' +
'get given global if ignoring in into is it its last local me ' +
'middle mod my ninth not of on onto or over prop property put ref ' +
'reference repeat returning script second set seventh since ' +
'sixth some tell tenth that the|0 then third through thru ' +
'timeout times to transaction try until where while whose with ' +
'without',
literal:
'AppleScript false linefeed return pi quote result space tab true',
built_in:
'alias application boolean class constant date file integer list ' +
'number real record string text ' +
'activate beep count delay launch log offset read round ' +
'run say summarize write ' +
'character characters contents day frontmost id item length ' +
'month name paragraph paragraphs rest reverse running time version ' +
'weekday word words year'
},
contains: [
STRING,
hljs.C_NUMBER_MODE,
{
className: 'built_in',
begin: regex.concat(
/\b/,
regex.either(...BUILT_IN_PATTERNS),
/\b/
)
},
{
className: 'built_in',
begin: /^\s*return\b/
},
{
className: 'literal',
begin:
/\b(text item delimiters|current application|missing value)\b/
},
{
className: 'keyword',
begin: regex.concat(
/\b/,
regex.either(...KEYWORD_PATTERNS),
/\b/
)
},
{
beginKeywords: 'on',
illegal: /[${=;\n]/,
contains: [
hljs.UNDERSCORE_TITLE_MODE,
PARAMS
]
},
...COMMENTS
],
illegal: /\/\/|->|=>|\[\[/
};
}
module.exports = applescript;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/arcade.js":
/*!***********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/arcade.js ***!
\***********************************************************/
/***/ ((module) => {
/*
Language: ArcGIS Arcade
Category: scripting
Author: John Foster
Website: https://developers.arcgis.com/arcade/
Description: ArcGIS Arcade is an expression language used in many Esri ArcGIS products such as Pro, Online, Server, Runtime, JavaScript, and Python
*/
/** @type LanguageFn */
function arcade(hljs) {
const IDENT_RE = '[A-Za-z_][0-9A-Za-z_]*';
const KEYWORDS = {
keyword:
'if for while var new function do return void else break',
literal:
'BackSlash DoubleQuote false ForwardSlash Infinity NaN NewLine null PI SingleQuote Tab TextFormatting true undefined',
built_in:
'Abs Acos Angle Attachments Area AreaGeodetic Asin Atan Atan2 Average Bearing Boolean Buffer BufferGeodetic ' +
'Ceil Centroid Clip Console Constrain Contains Cos Count Crosses Cut Date DateAdd ' +
'DateDiff Day Decode DefaultValue Dictionary Difference Disjoint Distance DistanceGeodetic Distinct ' +
'DomainCode DomainName Equals Exp Extent Feature FeatureSet FeatureSetByAssociation FeatureSetById FeatureSetByPortalItem ' +
'FeatureSetByRelationshipName FeatureSetByTitle FeatureSetByUrl Filter First Floor Geometry GroupBy Guid HasKey Hour IIf IndexOf ' +
'Intersection Intersects IsEmpty IsNan IsSelfIntersecting Length LengthGeodetic Log Max Mean Millisecond Min Minute Month ' +
'MultiPartToSinglePart Multipoint NextSequenceValue Now Number OrderBy Overlaps Point Polygon ' +
'Polyline Portal Pow Random Relate Reverse RingIsClockWise Round Second SetGeometry Sin Sort Sqrt Stdev Sum ' +
'SymmetricDifference Tan Text Timestamp Today ToLocal Top Touches ToUTC TrackCurrentTime ' +
'TrackGeometryWindow TrackIndex TrackStartTime TrackWindow TypeOf Union UrlEncode Variance ' +
'Weekday When Within Year '
};
const SYMBOL = {
className: 'symbol',
begin: '\\$[datastore|feature|layer|map|measure|sourcefeature|sourcelayer|targetfeature|targetlayer|value|view]+'
};
const NUMBER = {
className: 'number',
variants: [
{
begin: '\\b(0[bB][01]+)'
},
{
begin: '\\b(0[oO][0-7]+)'
},
{
begin: hljs.C_NUMBER_RE
}
],
relevance: 0
};
const SUBST = {
className: 'subst',
begin: '\\$\\{',
end: '\\}',
keywords: KEYWORDS,
contains: [] // defined later
};
const TEMPLATE_STRING = {
className: 'string',
begin: '`',
end: '`',
contains: [
hljs.BACKSLASH_ESCAPE,
SUBST
]
};
SUBST.contains = [
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE,
TEMPLATE_STRING,
NUMBER,
hljs.REGEXP_MODE
];
const PARAMS_CONTAINS = SUBST.contains.concat([
hljs.C_BLOCK_COMMENT_MODE,
hljs.C_LINE_COMMENT_MODE
]);
return {
name: 'ArcGIS Arcade',
keywords: KEYWORDS,
contains: [
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE,
TEMPLATE_STRING,
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
SYMBOL,
NUMBER,
{ // object attr container
begin: /[{,]\s*/,
relevance: 0,
contains: [{
begin: IDENT_RE + '\\s*:',
returnBegin: true,
relevance: 0,
contains: [{
className: 'attr',
begin: IDENT_RE,
relevance: 0
}]
}]
},
{ // "value" container
begin: '(' + hljs.RE_STARTERS_RE + '|\\b(return)\\b)\\s*',
keywords: 'return',
contains: [
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
hljs.REGEXP_MODE,
{
className: 'function',
begin: '(\\(.*?\\)|' + IDENT_RE + ')\\s*=>',
returnBegin: true,
end: '\\s*=>',
contains: [{
className: 'params',
variants: [
{
begin: IDENT_RE
},
{
begin: /\(\s*\)/
},
{
begin: /\(/,
end: /\)/,
excludeBegin: true,
excludeEnd: true,
keywords: KEYWORDS,
contains: PARAMS_CONTAINS
}
]
}]
}
],
relevance: 0
},
{
beginKeywords: 'function',
end: /\{/,
excludeEnd: true,
contains: [
hljs.inherit(hljs.TITLE_MODE, {
className: "title.function",
begin: IDENT_RE
}),
{
className: 'params',
begin: /\(/,
end: /\)/,
excludeBegin: true,
excludeEnd: true,
contains: PARAMS_CONTAINS
}
],
illegal: /\[|%/
},
{
begin: /\$[(.]/
}
],
illegal: /#(?!!)/
};
}
module.exports = arcade;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/arduino.js":
/*!************************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/arduino.js ***!
\************************************************************/
/***/ ((module) => {
/*
Language: C++
Category: common, system
Website: https://isocpp.org
*/
/** @type LanguageFn */
function cPlusPlus(hljs) {
const regex = hljs.regex;
// added for historic reasons because `hljs.C_LINE_COMMENT_MODE` does
// not include such support nor can we be sure all the grammars depending
// on it would desire this behavior
const C_LINE_COMMENT_MODE = hljs.COMMENT('//', '$', {
contains: [
{
begin: /\\\n/
}
]
});
const DECLTYPE_AUTO_RE = 'decltype\\(auto\\)';
const NAMESPACE_RE = '[a-zA-Z_]\\w*::';
const TEMPLATE_ARGUMENT_RE = '<[^<>]+>';
const FUNCTION_TYPE_RE = '(?!struct)(' +
DECLTYPE_AUTO_RE + '|' +
regex.optional(NAMESPACE_RE) +
'[a-zA-Z_]\\w*' + regex.optional(TEMPLATE_ARGUMENT_RE) +
')';
const CPP_PRIMITIVE_TYPES = {
className: 'type',
begin: '\\b[a-z\\d_]*_t\\b'
};
// https://en.cppreference.com/w/cpp/language/escape
// \\ \x \xFF \u2837 \u00323747 \374
const CHARACTER_ESCAPES = '\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)';
const STRINGS = {
className: 'string',
variants: [
{
begin: '(u8?|U|L)?"',
end: '"',
illegal: '\\n',
contains: [ hljs.BACKSLASH_ESCAPE ]
},
{
begin: '(u8?|U|L)?\'(' + CHARACTER_ESCAPES + '|.)',
end: '\'',
illegal: '.'
},
hljs.END_SAME_AS_BEGIN({
begin: /(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,
end: /\)([^()\\ ]{0,16})"/
})
]
};
const NUMBERS = {
className: 'number',
variants: [
{
begin: '\\b(0b[01\']+)'
},
{
begin: '(-?)\\b([\\d\']+(\\.[\\d\']*)?|\\.[\\d\']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)'
},
{
begin: '(-?)(\\b0[xX][a-fA-F0-9\']+|(\\b[\\d\']+(\\.[\\d\']*)?|\\.[\\d\']+)([eE][-+]?[\\d\']+)?)'
}
],
relevance: 0
};
const PREPROCESSOR = {
className: 'meta',
begin: /#\s*[a-z]+\b/,
end: /$/,
keywords: {
keyword:
'if else elif endif define undef warning error line ' +
'pragma _Pragma ifdef ifndef include'
},
contains: [
{
begin: /\\\n/,
relevance: 0
},
hljs.inherit(STRINGS, {
className: 'string'
}),
{
className: 'string',
begin: /<.*?>/
},
C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE
]
};
const TITLE_MODE = {
className: 'title',
begin: regex.optional(NAMESPACE_RE) + hljs.IDENT_RE,
relevance: 0
};
const FUNCTION_TITLE = regex.optional(NAMESPACE_RE) + hljs.IDENT_RE + '\\s*\\(';
// https://en.cppreference.com/w/cpp/keyword
const RESERVED_KEYWORDS = [
'alignas',
'alignof',
'and',
'and_eq',
'asm',
'atomic_cancel',
'atomic_commit',
'atomic_noexcept',
'auto',
'bitand',
'bitor',
'break',
'case',
'catch',
'class',
'co_await',
'co_return',
'co_yield',
'compl',
'concept',
'const_cast|10',
'consteval',
'constexpr',
'constinit',
'continue',
'decltype',
'default',
'delete',
'do',
'dynamic_cast|10',
'else',
'enum',
'explicit',
'export',
'extern',
'false',
'final',
'for',
'friend',
'goto',
'if',
'import',
'inline',
'module',
'mutable',
'namespace',
'new',
'noexcept',
'not',
'not_eq',
'nullptr',
'operator',
'or',
'or_eq',
'override',
'private',
'protected',
'public',
'reflexpr',
'register',
'reinterpret_cast|10',
'requires',
'return',
'sizeof',
'static_assert',
'static_cast|10',
'struct',
'switch',
'synchronized',
'template',
'this',
'thread_local',
'throw',
'transaction_safe',
'transaction_safe_dynamic',
'true',
'try',
'typedef',
'typeid',
'typename',
'union',
'using',
'virtual',
'volatile',
'while',
'xor',
'xor_eq'
];
// https://en.cppreference.com/w/cpp/keyword
const RESERVED_TYPES = [
'bool',
'char',
'char16_t',
'char32_t',
'char8_t',
'double',
'float',
'int',
'long',
'short',
'void',
'wchar_t',
'unsigned',
'signed',
'const',
'static'
];
const TYPE_HINTS = [
'any',
'auto_ptr',
'barrier',
'binary_semaphore',
'bitset',
'complex',
'condition_variable',
'condition_variable_any',
'counting_semaphore',
'deque',
'false_type',
'future',
'imaginary',
'initializer_list',
'istringstream',
'jthread',
'latch',
'lock_guard',
'multimap',
'multiset',
'mutex',
'optional',
'ostringstream',
'packaged_task',
'pair',
'promise',
'priority_queue',
'queue',
'recursive_mutex',
'recursive_timed_mutex',
'scoped_lock',
'set',
'shared_future',
'shared_lock',
'shared_mutex',
'shared_timed_mutex',
'shared_ptr',
'stack',
'string_view',
'stringstream',
'timed_mutex',
'thread',
'true_type',
'tuple',
'unique_lock',
'unique_ptr',
'unordered_map',
'unordered_multimap',
'unordered_multiset',
'unordered_set',
'variant',
'vector',
'weak_ptr',
'wstring',
'wstring_view'
];
const FUNCTION_HINTS = [
'abort',
'abs',
'acos',
'apply',
'as_const',
'asin',
'atan',
'atan2',
'calloc',
'ceil',
'cerr',
'cin',
'clog',
'cos',
'cosh',
'cout',
'declval',
'endl',
'exchange',
'exit',
'exp',
'fabs',
'floor',
'fmod',
'forward',
'fprintf',
'fputs',
'free',
'frexp',
'fscanf',
'future',
'invoke',
'isalnum',
'isalpha',
'iscntrl',
'isdigit',
'isgraph',
'islower',
'isprint',
'ispunct',
'isspace',
'isupper',
'isxdigit',
'labs',
'launder',
'ldexp',
'log',
'log10',
'make_pair',
'make_shared',
'make_shared_for_overwrite',
'make_tuple',
'make_unique',
'malloc',
'memchr',
'memcmp',
'memcpy',
'memset',
'modf',
'move',
'pow',
'printf',
'putchar',
'puts',
'realloc',
'scanf',
'sin',
'sinh',
'snprintf',
'sprintf',
'sqrt',
'sscanf',
'std',
'stderr',
'stdin',
'stdout',
'strcat',
'strchr',
'strcmp',
'strcpy',
'strcspn',
'strlen',
'strncat',
'strncmp',
'strncpy',
'strpbrk',
'strrchr',
'strspn',
'strstr',
'swap',
'tan',
'tanh',
'terminate',
'to_underlying',
'tolower',
'toupper',
'vfprintf',
'visit',
'vprintf',
'vsprintf'
];
const LITERALS = [
'NULL',
'false',
'nullopt',
'nullptr',
'true'
];
// https://en.cppreference.com/w/cpp/keyword
const BUILT_IN = [
'_Pragma'
];
const CPP_KEYWORDS = {
type: RESERVED_TYPES,
keyword: RESERVED_KEYWORDS,
literal: LITERALS,
built_in: BUILT_IN,
_type_hints: TYPE_HINTS
};
const FUNCTION_DISPATCH = {
className: 'function.dispatch',
relevance: 0,
keywords: {
// Only for relevance, not highlighting.
_hint: FUNCTION_HINTS
},
begin: regex.concat(
/\b/,
/(?!decltype)/,
/(?!if)/,
/(?!for)/,
/(?!switch)/,
/(?!while)/,
hljs.IDENT_RE,
regex.lookahead(/(<[^<>]+>|)\s*\(/))
};
const EXPRESSION_CONTAINS = [
FUNCTION_DISPATCH,
PREPROCESSOR,
CPP_PRIMITIVE_TYPES,
C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
NUMBERS,
STRINGS
];
const EXPRESSION_CONTEXT = {
// This mode covers expression context where we can't expect a function
// definition and shouldn't highlight anything that looks like one:
// `return some()`, `else if()`, `(x*sum(1, 2))`
variants: [
{
begin: /=/,
end: /;/
},
{
begin: /\(/,
end: /\)/
},
{
beginKeywords: 'new throw return else',
end: /;/
}
],
keywords: CPP_KEYWORDS,
contains: EXPRESSION_CONTAINS.concat([
{
begin: /\(/,
end: /\)/,
keywords: CPP_KEYWORDS,
contains: EXPRESSION_CONTAINS.concat([ 'self' ]),
relevance: 0
}
]),
relevance: 0
};
const FUNCTION_DECLARATION = {
className: 'function',
begin: '(' + FUNCTION_TYPE_RE + '[\\*&\\s]+)+' + FUNCTION_TITLE,
returnBegin: true,
end: /[{;=]/,
excludeEnd: true,
keywords: CPP_KEYWORDS,
illegal: /[^\w\s\*&:<>.]/,
contains: [
{ // to prevent it from being confused as the function title
begin: DECLTYPE_AUTO_RE,
keywords: CPP_KEYWORDS,
relevance: 0
},
{
begin: FUNCTION_TITLE,
returnBegin: true,
contains: [ TITLE_MODE ],
relevance: 0
},
// needed because we do not have look-behind on the below rule
// to prevent it from grabbing the final : in a :: pair
{
begin: /::/,
relevance: 0
},
// initializers
{
begin: /:/,
endsWithParent: true,
contains: [
STRINGS,
NUMBERS
]
},
// allow for multiple declarations, e.g.:
// extern void f(int), g(char);
{
relevance: 0,
match: /,/
},
{
className: 'params',
begin: /\(/,
end: /\)/,
keywords: CPP_KEYWORDS,
relevance: 0,
contains: [
C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
STRINGS,
NUMBERS,
CPP_PRIMITIVE_TYPES,
// Count matching parentheses.
{
begin: /\(/,
end: /\)/,
keywords: CPP_KEYWORDS,
relevance: 0,
contains: [
'self',
C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
STRINGS,
NUMBERS,
CPP_PRIMITIVE_TYPES
]
}
]
},
CPP_PRIMITIVE_TYPES,
C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
PREPROCESSOR
]
};
return {
name: 'C++',
aliases: [
'cc',
'c++',
'h++',
'hpp',
'hh',
'hxx',
'cxx'
],
keywords: CPP_KEYWORDS,
illegal: '',
classNameAliases: {
'function.dispatch': 'built_in'
},
contains: [].concat(
EXPRESSION_CONTEXT,
FUNCTION_DECLARATION,
FUNCTION_DISPATCH,
EXPRESSION_CONTAINS,
[
PREPROCESSOR,
{ // containers: ie, `vector rooms (9);`
begin: '\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<',
end: '>',
keywords: CPP_KEYWORDS,
contains: [
'self',
CPP_PRIMITIVE_TYPES
]
},
{
begin: hljs.IDENT_RE + '::',
keywords: CPP_KEYWORDS
},
{
match: [
// extra complexity to deal with `enum class` and `enum struct`
/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,
/\s+/,
/\w+/
],
className: {
1: 'keyword',
3: 'title.class'
}
}
])
};
}
/*
Language: Arduino
Author: Stefania Mellai
Description: The Arduino® Language is a superset of C++. This rules are designed to highlight the Arduino® source code. For info about language see http://www.arduino.cc.
Website: https://www.arduino.cc
*/
/** @type LanguageFn */
function arduino(hljs) {
const ARDUINO_KW = {
type: [
"boolean",
"byte",
"word",
"String"
],
built_in: [
"KeyboardController",
"MouseController",
"SoftwareSerial",
"EthernetServer",
"EthernetClient",
"LiquidCrystal",
"RobotControl",
"GSMVoiceCall",
"EthernetUDP",
"EsploraTFT",
"HttpClient",
"RobotMotor",
"WiFiClient",
"GSMScanner",
"FileSystem",
"Scheduler",
"GSMServer",
"YunClient",
"YunServer",
"IPAddress",
"GSMClient",
"GSMModem",
"Keyboard",
"Ethernet",
"Console",
"GSMBand",
"Esplora",
"Stepper",
"Process",
"WiFiUDP",
"GSM_SMS",
"Mailbox",
"USBHost",
"Firmata",
"PImage",
"Client",
"Server",
"GSMPIN",
"FileIO",
"Bridge",
"Serial",
"EEPROM",
"Stream",
"Mouse",
"Audio",
"Servo",
"File",
"Task",
"GPRS",
"WiFi",
"Wire",
"TFT",
"GSM",
"SPI",
"SD"
],
_hints: [
"setup",
"loop",
"runShellCommandAsynchronously",
"analogWriteResolution",
"retrieveCallingNumber",
"printFirmwareVersion",
"analogReadResolution",
"sendDigitalPortPair",
"noListenOnLocalhost",
"readJoystickButton",
"setFirmwareVersion",
"readJoystickSwitch",
"scrollDisplayRight",
"getVoiceCallStatus",
"scrollDisplayLeft",
"writeMicroseconds",
"delayMicroseconds",
"beginTransmission",
"getSignalStrength",
"runAsynchronously",
"getAsynchronously",
"listenOnLocalhost",
"getCurrentCarrier",
"readAccelerometer",
"messageAvailable",
"sendDigitalPorts",
"lineFollowConfig",
"countryNameWrite",
"runShellCommand",
"readStringUntil",
"rewindDirectory",
"readTemperature",
"setClockDivider",
"readLightSensor",
"endTransmission",
"analogReference",
"detachInterrupt",
"countryNameRead",
"attachInterrupt",
"encryptionType",
"readBytesUntil",
"robotNameWrite",
"readMicrophone",
"robotNameRead",
"cityNameWrite",
"userNameWrite",
"readJoystickY",
"readJoystickX",
"mouseReleased",
"openNextFile",
"scanNetworks",
"noInterrupts",
"digitalWrite",
"beginSpeaker",
"mousePressed",
"isActionDone",
"mouseDragged",
"displayLogos",
"noAutoscroll",
"addParameter",
"remoteNumber",
"getModifiers",
"keyboardRead",
"userNameRead",
"waitContinue",
"processInput",
"parseCommand",
"printVersion",
"readNetworks",
"writeMessage",
"blinkVersion",
"cityNameRead",
"readMessage",
"setDataMode",
"parsePacket",
"isListening",
"setBitOrder",
"beginPacket",
"isDirectory",
"motorsWrite",
"drawCompass",
"digitalRead",
"clearScreen",
"serialEvent",
"rightToLeft",
"setTextSize",
"leftToRight",
"requestFrom",
"keyReleased",
"compassRead",
"analogWrite",
"interrupts",
"WiFiServer",
"disconnect",
"playMelody",
"parseFloat",
"autoscroll",
"getPINUsed",
"setPINUsed",
"setTimeout",
"sendAnalog",
"readSlider",
"analogRead",
"beginWrite",
"createChar",
"motorsStop",
"keyPressed",
"tempoWrite",
"readButton",
"subnetMask",
"debugPrint",
"macAddress",
"writeGreen",
"randomSeed",
"attachGPRS",
"readString",
"sendString",
"remotePort",
"releaseAll",
"mouseMoved",
"background",
"getXChange",
"getYChange",
"answerCall",
"getResult",
"voiceCall",
"endPacket",
"constrain",
"getSocket",
"writeJSON",
"getButton",
"available",
"connected",
"findUntil",
"readBytes",
"exitValue",
"readGreen",
"writeBlue",
"startLoop",
"IPAddress",
"isPressed",
"sendSysex",
"pauseMode",
"gatewayIP",
"setCursor",
"getOemKey",
"tuneWrite",
"noDisplay",
"loadImage",
"switchPIN",
"onRequest",
"onReceive",
"changePIN",
"playFile",
"noBuffer",
"parseInt",
"overflow",
"checkPIN",
"knobRead",
"beginTFT",
"bitClear",
"updateIR",
"bitWrite",
"position",
"writeRGB",
"highByte",
"writeRed",
"setSpeed",
"readBlue",
"noStroke",
"remoteIP",
"transfer",
"shutdown",
"hangCall",
"beginSMS",
"endWrite",
"attached",
"maintain",
"noCursor",
"checkReg",
"checkPUK",
"shiftOut",
"isValid",
"shiftIn",
"pulseIn",
"connect",
"println",
"localIP",
"pinMode",
"getIMEI",
"display",
"noBlink",
"process",
"getBand",
"running",
"beginSD",
"drawBMP",
"lowByte",
"setBand",
"release",
"bitRead",
"prepare",
"pointTo",
"readRed",
"setMode",
"noFill",
"remove",
"listen",
"stroke",
"detach",
"attach",
"noTone",
"exists",
"buffer",
"height",
"bitSet",
"circle",
"config",
"cursor",
"random",
"IRread",
"setDNS",
"endSMS",
"getKey",
"micros",
"millis",
"begin",
"print",
"write",
"ready",
"flush",
"width",
"isPIN",
"blink",
"clear",
"press",
"mkdir",
"rmdir",
"close",
"point",
"yield",
"image",
"BSSID",
"click",
"delay",
"read",
"text",
"move",
"peek",
"beep",
"rect",
"line",
"open",
"seek",
"fill",
"size",
"turn",
"stop",
"home",
"find",
"step",
"tone",
"sqrt",
"RSSI",
"SSID",
"end",
"bit",
"tan",
"cos",
"sin",
"pow",
"map",
"abs",
"max",
"min",
"get",
"run",
"put"
],
literal: [
"DIGITAL_MESSAGE",
"FIRMATA_STRING",
"ANALOG_MESSAGE",
"REPORT_DIGITAL",
"REPORT_ANALOG",
"INPUT_PULLUP",
"SET_PIN_MODE",
"INTERNAL2V56",
"SYSTEM_RESET",
"LED_BUILTIN",
"INTERNAL1V1",
"SYSEX_START",
"INTERNAL",
"EXTERNAL",
"DEFAULT",
"OUTPUT",
"INPUT",
"HIGH",
"LOW"
]
};
const ARDUINO = cPlusPlus(hljs);
const kws = /** @type {Record} */ (ARDUINO.keywords);
kws.type = [ ...kws.type, ...ARDUINO_KW.type ];
kws.literal = [ ...kws.literal, ...ARDUINO_KW.literal ];
kws.built_in = [ ...kws.built_in, ...ARDUINO_KW.built_in ];
kws._hints = ARDUINO_KW._hints;
ARDUINO.name = 'Arduino';
ARDUINO.aliases = ['ino'];
ARDUINO.supersetOf = "cpp";
return ARDUINO;
}
module.exports = arduino;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/armasm.js":
/*!***********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/armasm.js ***!
\***********************************************************/
/***/ ((module) => {
/*
Language: ARM Assembly
Author: Dan Panzarella
Description: ARM Assembly including Thumb and Thumb2 instructions
Category: assembler
*/
/** @type LanguageFn */
function armasm(hljs) {
// local labels: %?[FB]?[AT]?\d{1,2}\w+
const COMMENT = {
variants: [
hljs.COMMENT('^[ \\t]*(?=#)', '$', {
relevance: 0,
excludeBegin: true
}),
hljs.COMMENT('[;@]', '$', {
relevance: 0
}),
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE
]
};
return {
name: 'ARM Assembly',
case_insensitive: true,
aliases: ['arm'],
keywords: {
$pattern: '\\.?' + hljs.IDENT_RE,
meta:
// GNU preprocs
'.2byte .4byte .align .ascii .asciz .balign .byte .code .data .else .end .endif .endm .endr .equ .err .exitm .extern .global .hword .if .ifdef .ifndef .include .irp .long .macro .rept .req .section .set .skip .space .text .word .arm .thumb .code16 .code32 .force_thumb .thumb_func .ltorg ' +
// ARM directives
'ALIAS ALIGN ARM AREA ASSERT ATTR CN CODE CODE16 CODE32 COMMON CP DATA DCB DCD DCDU DCDO DCFD DCFDU DCI DCQ DCQU DCW DCWU DN ELIF ELSE END ENDFUNC ENDIF ENDP ENTRY EQU EXPORT EXPORTAS EXTERN FIELD FILL FUNCTION GBLA GBLL GBLS GET GLOBAL IF IMPORT INCBIN INCLUDE INFO KEEP LCLA LCLL LCLS LTORG MACRO MAP MEND MEXIT NOFP OPT PRESERVE8 PROC QN READONLY RELOC REQUIRE REQUIRE8 RLIST FN ROUT SETA SETL SETS SN SPACE SUBT THUMB THUMBX TTL WHILE WEND ',
built_in:
'r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 ' + // standard registers
'pc lr sp ip sl sb fp ' + // typical regs plus backward compatibility
'a1 a2 a3 a4 v1 v2 v3 v4 v5 v6 v7 v8 f0 f1 f2 f3 f4 f5 f6 f7 ' + // more regs and fp
'p0 p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 ' + // coprocessor regs
'c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 ' + // more coproc
'q0 q1 q2 q3 q4 q5 q6 q7 q8 q9 q10 q11 q12 q13 q14 q15 ' + // advanced SIMD NEON regs
// program status registers
'cpsr_c cpsr_x cpsr_s cpsr_f cpsr_cx cpsr_cxs cpsr_xs cpsr_xsf cpsr_sf cpsr_cxsf ' +
'spsr_c spsr_x spsr_s spsr_f spsr_cx spsr_cxs spsr_xs spsr_xsf spsr_sf spsr_cxsf ' +
// NEON and VFP registers
's0 s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 s11 s12 s13 s14 s15 ' +
's16 s17 s18 s19 s20 s21 s22 s23 s24 s25 s26 s27 s28 s29 s30 s31 ' +
'd0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 ' +
'd16 d17 d18 d19 d20 d21 d22 d23 d24 d25 d26 d27 d28 d29 d30 d31 ' +
'{PC} {VAR} {TRUE} {FALSE} {OPT} {CONFIG} {ENDIAN} {CODESIZE} {CPU} {FPU} {ARCHITECTURE} {PCSTOREOFFSET} {ARMASM_VERSION} {INTER} {ROPI} {RWPI} {SWST} {NOSWST} . @'
},
contains: [
{
className: 'keyword',
begin: '\\b(' + // mnemonics
'adc|' +
'(qd?|sh?|u[qh]?)?add(8|16)?|usada?8|(q|sh?|u[qh]?)?(as|sa)x|' +
'and|adrl?|sbc|rs[bc]|asr|b[lx]?|blx|bxj|cbn?z|tb[bh]|bic|' +
'bfc|bfi|[su]bfx|bkpt|cdp2?|clz|clrex|cmp|cmn|cpsi[ed]|cps|' +
'setend|dbg|dmb|dsb|eor|isb|it[te]{0,3}|lsl|lsr|ror|rrx|' +
'ldm(([id][ab])|f[ds])?|ldr((s|ex)?[bhd])?|movt?|mvn|mra|mar|' +
'mul|[us]mull|smul[bwt][bt]|smu[as]d|smmul|smmla|' +
'mla|umlaal|smlal?([wbt][bt]|d)|mls|smlsl?[ds]|smc|svc|sev|' +
'mia([bt]{2}|ph)?|mrr?c2?|mcrr2?|mrs|msr|orr|orn|pkh(tb|bt)|rbit|' +
'rev(16|sh)?|sel|[su]sat(16)?|nop|pop|push|rfe([id][ab])?|' +
'stm([id][ab])?|str(ex)?[bhd]?|(qd?)?sub|(sh?|q|u[qh]?)?sub(8|16)|' +
'[su]xt(a?h|a?b(16)?)|srs([id][ab])?|swpb?|swi|smi|tst|teq|' +
'wfe|wfi|yield' +
')' +
'(eq|ne|cs|cc|mi|pl|vs|vc|hi|ls|ge|lt|gt|le|al|hs|lo)?' + // condition codes
'[sptrx]?' + // legal postfixes
'(?=\\s)' // followed by space
},
COMMENT,
hljs.QUOTE_STRING_MODE,
{
className: 'string',
begin: '\'',
end: '[^\\\\]\'',
relevance: 0
},
{
className: 'title',
begin: '\\|',
end: '\\|',
illegal: '\\n',
relevance: 0
},
{
className: 'number',
variants: [
{ // hex
begin: '[#$=]?0x[0-9a-f]+'
},
{ // bin
begin: '[#$=]?0b[01]+'
},
{ // literal
begin: '[#$=]\\d+'
},
{ // bare number
begin: '\\b\\d+'
}
],
relevance: 0
},
{
className: 'symbol',
variants: [
{ // GNU ARM syntax
begin: '^[ \\t]*[a-z_\\.\\$][a-z0-9_\\.\\$]+:'
},
{ // ARM syntax
begin: '^[a-z_\\.\\$][a-z0-9_\\.\\$]+'
},
{ // label reference
begin: '[=#]\\w+'
}
],
relevance: 0
}
]
};
}
module.exports = armasm;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/asciidoc.js":
/*!*************************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/asciidoc.js ***!
\*************************************************************/
/***/ ((module) => {
/*
Language: AsciiDoc
Requires: xml.js
Author: Dan Allen
Website: http://asciidoc.org
Description: A semantic, text-based document format that can be exported to HTML, DocBook and other backends.
Category: markup
*/
/** @type LanguageFn */
function asciidoc(hljs) {
const regex = hljs.regex;
const HORIZONTAL_RULE = {
begin: '^\'{3,}[ \\t]*$',
relevance: 10
};
const ESCAPED_FORMATTING = [
// escaped constrained formatting marks (i.e., \* \_ or \`)
{
begin: /\\[*_`]/
},
// escaped unconstrained formatting marks (i.e., \\** \\__ or \\``)
// must ignore until the next formatting marks
// this rule might not be 100% compliant with Asciidoctor 2.0 but we are entering undefined behavior territory...
{
begin: /\\\\\*{2}[^\n]*?\*{2}/
},
{
begin: /\\\\_{2}[^\n]*_{2}/
},
{
begin: /\\\\`{2}[^\n]*`{2}/
},
// guard: constrained formatting mark may not be preceded by ":", ";" or
// "}". match these so the constrained rule doesn't see them
{
begin: /[:;}][*_`](?![*_`])/
}
];
const STRONG = [
// inline unconstrained strong (single line)
{
className: 'strong',
begin: /\*{2}([^\n]+?)\*{2}/
},
// inline unconstrained strong (multi-line)
{
className: 'strong',
begin: regex.concat(
/\*\*/,
/((\*(?!\*)|\\[^\n]|[^*\n\\])+\n)+/,
/(\*(?!\*)|\\[^\n]|[^*\n\\])*/,
/\*\*/
),
relevance: 0
},
// inline constrained strong (single line)
{
className: 'strong',
// must not precede or follow a word character
begin: /\B\*(\S|\S[^\n]*?\S)\*(?!\w)/
},
// inline constrained strong (multi-line)
{
className: 'strong',
// must not precede or follow a word character
begin: /\*[^\s]([^\n]+\n)+([^\n]+)\*/
}
];
const EMPHASIS = [
// inline unconstrained emphasis (single line)
{
className: 'emphasis',
begin: /_{2}([^\n]+?)_{2}/
},
// inline unconstrained emphasis (multi-line)
{
className: 'emphasis',
begin: regex.concat(
/__/,
/((_(?!_)|\\[^\n]|[^_\n\\])+\n)+/,
/(_(?!_)|\\[^\n]|[^_\n\\])*/,
/__/
),
relevance: 0
},
// inline constrained emphasis (single line)
{
className: 'emphasis',
// must not precede or follow a word character
begin: /\b_(\S|\S[^\n]*?\S)_(?!\w)/
},
// inline constrained emphasis (multi-line)
{
className: 'emphasis',
// must not precede or follow a word character
begin: /_[^\s]([^\n]+\n)+([^\n]+)_/
},
// inline constrained emphasis using single quote (legacy)
{
className: 'emphasis',
// must not follow a word character or be followed by a single quote or space
begin: '\\B\'(?![\'\\s])',
end: '(\\n{2}|\')',
// allow escaped single quote followed by word char
contains: [{
begin: '\\\\\'\\w',
relevance: 0
}],
relevance: 0
}
];
const ADMONITION = {
className: 'symbol',
begin: '^(NOTE|TIP|IMPORTANT|WARNING|CAUTION):\\s+',
relevance: 10
};
const BULLET_LIST = {
className: 'bullet',
begin: '^(\\*+|-+|\\.+|[^\\n]+?::)\\s+'
};
return {
name: 'AsciiDoc',
aliases: ['adoc'],
contains: [
// block comment
hljs.COMMENT(
'^/{4,}\\n',
'\\n/{4,}$',
// can also be done as...
// '^/{4,}$',
// '^/{4,}$',
{
relevance: 10
}
),
// line comment
hljs.COMMENT(
'^//',
'$',
{
relevance: 0
}
),
// title
{
className: 'title',
begin: '^\\.\\w.*$'
},
// example, admonition & sidebar blocks
{
begin: '^[=\\*]{4,}\\n',
end: '\\n^[=\\*]{4,}$',
relevance: 10
},
// headings
{
className: 'section',
relevance: 10,
variants: [
{
begin: '^(={1,6})[ \t].+?([ \t]\\1)?$'
},
{
begin: '^[^\\[\\]\\n]+?\\n[=\\-~\\^\\+]{2,}$'
}
]
},
// document attributes
{
className: 'meta',
begin: '^:.+?:',
end: '\\s',
excludeEnd: true,
relevance: 10
},
// block attributes
{
className: 'meta',
begin: '^\\[.+?\\]$',
relevance: 0
},
// quoteblocks
{
className: 'quote',
begin: '^_{4,}\\n',
end: '\\n_{4,}$',
relevance: 10
},
// listing and literal blocks
{
className: 'code',
begin: '^[\\-\\.]{4,}\\n',
end: '\\n[\\-\\.]{4,}$',
relevance: 10
},
// passthrough blocks
{
begin: '^\\+{4,}\\n',
end: '\\n\\+{4,}$',
contains: [{
begin: '<',
end: '>',
subLanguage: 'xml',
relevance: 0
}],
relevance: 10
},
BULLET_LIST,
ADMONITION,
...ESCAPED_FORMATTING,
...STRONG,
...EMPHASIS,
// inline smart quotes
{
className: 'string',
variants: [
{
begin: "``.+?''"
},
{
begin: "`.+?'"
}
]
},
// inline unconstrained emphasis
{
className: 'code',
begin: /`{2}/,
end: /(\n{2}|`{2})/
},
// inline code snippets (TODO should get same treatment as strong and emphasis)
{
className: 'code',
begin: '(`.+?`|\\+.+?\\+)',
relevance: 0
},
// indented literal block
{
className: 'code',
begin: '^[ \\t]',
end: '$',
relevance: 0
},
HORIZONTAL_RULE,
// images and links
{
begin: '(link:)?(http|https|ftp|file|irc|image:?):\\S+?\\[[^[]*?\\]',
returnBegin: true,
contains: [
{
begin: '(link|image:?):',
relevance: 0
},
{
className: 'link',
begin: '\\w',
end: '[^\\[]+',
relevance: 0
},
{
className: 'string',
begin: '\\[',
end: '\\]',
excludeBegin: true,
excludeEnd: true,
relevance: 0
}
],
relevance: 10
}
]
};
}
module.exports = asciidoc;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/aspectj.js":
/*!************************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/aspectj.js ***!
\************************************************************/
/***/ ((module) => {
/*
Language: AspectJ
Author: Hakan Ozler
Website: https://www.eclipse.org/aspectj/
Description: Syntax Highlighting for the AspectJ Language which is a general-purpose aspect-oriented extension to the Java programming language.
Audit: 2020
*/
/** @type LanguageFn */
function aspectj(hljs) {
const regex = hljs.regex;
const KEYWORDS = [
"false",
"synchronized",
"int",
"abstract",
"float",
"private",
"char",
"boolean",
"static",
"null",
"if",
"const",
"for",
"true",
"while",
"long",
"throw",
"strictfp",
"finally",
"protected",
"import",
"native",
"final",
"return",
"void",
"enum",
"else",
"extends",
"implements",
"break",
"transient",
"new",
"catch",
"instanceof",
"byte",
"super",
"volatile",
"case",
"assert",
"short",
"package",
"default",
"double",
"public",
"try",
"this",
"switch",
"continue",
"throws",
"privileged",
"aspectOf",
"adviceexecution",
"proceed",
"cflowbelow",
"cflow",
"initialization",
"preinitialization",
"staticinitialization",
"withincode",
"target",
"within",
"execution",
"getWithinTypeName",
"handler",
"thisJoinPoint",
"thisJoinPointStaticPart",
"thisEnclosingJoinPointStaticPart",
"declare",
"parents",
"warning",
"error",
"soft",
"precedence",
"thisAspectInstance"
];
const SHORTKEYS = [
"get",
"set",
"args",
"call"
];
return {
name: 'AspectJ',
keywords: KEYWORDS,
illegal: /<\/|#/,
contains: [
hljs.COMMENT(
/\/\*\*/,
/\*\//,
{
relevance: 0,
contains: [
{
// eat up @'s in emails to prevent them to be recognized as doctags
begin: /\w+@/,
relevance: 0
},
{
className: 'doctag',
begin: /@[A-Za-z]+/
}
]
}
),
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE,
{
className: 'class',
beginKeywords: 'aspect',
end: /[{;=]/,
excludeEnd: true,
illegal: /[:;"\[\]]/,
contains: [
{
beginKeywords: 'extends implements pertypewithin perthis pertarget percflowbelow percflow issingleton'
},
hljs.UNDERSCORE_TITLE_MODE,
{
begin: /\([^\)]*/,
end: /[)]+/,
keywords: KEYWORDS.concat(SHORTKEYS),
excludeEnd: false
}
]
},
{
className: 'class',
beginKeywords: 'class interface',
end: /[{;=]/,
excludeEnd: true,
relevance: 0,
keywords: 'class interface',
illegal: /[:"\[\]]/,
contains: [
{
beginKeywords: 'extends implements'
},
hljs.UNDERSCORE_TITLE_MODE
]
},
{
// AspectJ Constructs
beginKeywords: 'pointcut after before around throwing returning',
end: /[)]/,
excludeEnd: false,
illegal: /["\[\]]/,
contains: [
{
begin: regex.concat(hljs.UNDERSCORE_IDENT_RE, /\s*\(/),
returnBegin: true,
contains: [ hljs.UNDERSCORE_TITLE_MODE ]
}
]
},
{
begin: /[:]/,
returnBegin: true,
end: /[{;]/,
relevance: 0,
excludeEnd: false,
keywords: KEYWORDS,
illegal: /["\[\]]/,
contains: [
{
begin: regex.concat(hljs.UNDERSCORE_IDENT_RE, /\s*\(/),
keywords: KEYWORDS.concat(SHORTKEYS),
relevance: 0
},
hljs.QUOTE_STRING_MODE
]
},
{
// this prevents 'new Name(...), or throw ...' from being recognized as a function definition
beginKeywords: 'new throw',
relevance: 0
},
{
// the function class is a bit different for AspectJ compared to the Java language
className: 'function',
begin: /\w+ +\w+(\.\w+)?\s*\([^\)]*\)\s*((throws)[\w\s,]+)?[\{;]/,
returnBegin: true,
end: /[{;=]/,
keywords: KEYWORDS,
excludeEnd: true,
contains: [
{
begin: regex.concat(hljs.UNDERSCORE_IDENT_RE, /\s*\(/),
returnBegin: true,
relevance: 0,
contains: [ hljs.UNDERSCORE_TITLE_MODE ]
},
{
className: 'params',
begin: /\(/,
end: /\)/,
relevance: 0,
keywords: KEYWORDS,
contains: [
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE,
hljs.C_NUMBER_MODE,
hljs.C_BLOCK_COMMENT_MODE
]
},
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE
]
},
hljs.C_NUMBER_MODE,
{
// annotation is also used in this language
className: 'meta',
begin: /@[A-Za-z]+/
}
]
};
}
module.exports = aspectj;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/autohotkey.js":
/*!***************************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/autohotkey.js ***!
\***************************************************************/
/***/ ((module) => {
/*
Language: AutoHotkey
Author: Seongwon Lee
Description: AutoHotkey language definition
Category: scripting
*/
/** @type LanguageFn */
function autohotkey(hljs) {
const BACKTICK_ESCAPE = {
begin: '`[\\s\\S]'
};
return {
name: 'AutoHotkey',
case_insensitive: true,
aliases: ['ahk'],
keywords: {
keyword: 'Break Continue Critical Exit ExitApp Gosub Goto New OnExit Pause return SetBatchLines SetTimer Suspend Thread Throw Until ahk_id ahk_class ahk_pid ahk_exe ahk_group',
literal: 'true false NOT AND OR',
built_in: 'ComSpec Clipboard ClipboardAll ErrorLevel'
},
contains: [
BACKTICK_ESCAPE,
hljs.inherit(hljs.QUOTE_STRING_MODE, {
contains: [BACKTICK_ESCAPE]
}),
hljs.COMMENT(';', '$', {
relevance: 0
}),
hljs.C_BLOCK_COMMENT_MODE,
{
className: 'number',
begin: hljs.NUMBER_RE,
relevance: 0
},
{
// subst would be the most accurate however fails the point of
// highlighting. variable is comparably the most accurate that actually
// has some effect
className: 'variable',
begin: '%[a-zA-Z0-9#_$@]+%'
},
{
className: 'built_in',
begin: '^\\s*\\w+\\s*(,|%)'
// I don't really know if this is totally relevant
},
{
// symbol would be most accurate however is highlighted just like
// built_in and that makes up a lot of AutoHotkey code meaning that it
// would fail to highlight anything
className: 'title',
variants: [
{
begin: '^[^\\n";]+::(?!=)'
},
{
begin: '^[^\\n";]+:(?!=)',
// zero relevance as it catches a lot of things
// followed by a single ':' in many languages
relevance: 0
}
]
},
{
className: 'meta',
begin: '^\\s*#\\w+',
end: '$',
relevance: 0
},
{
className: 'built_in',
begin: 'A_[a-zA-Z0-9]+'
},
{
// consecutive commas, not for highlighting but just for relevance
begin: ',\\s*,'
}
]
};
}
module.exports = autohotkey;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/autoit.js":
/*!***********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/autoit.js ***!
\***********************************************************/
/***/ ((module) => {
/*
Language: AutoIt
Author: Manh Tuan
Description: AutoIt language definition
Category: scripting
*/
/** @type LanguageFn */
function autoit(hljs) {
const KEYWORDS = 'ByRef Case Const ContinueCase ContinueLoop ' +
'Dim Do Else ElseIf EndFunc EndIf EndSelect ' +
'EndSwitch EndWith Enum Exit ExitLoop For Func ' +
'Global If In Local Next ReDim Return Select Static ' +
'Step Switch Then To Until Volatile WEnd While With';
const DIRECTIVES = [
"EndRegion",
"forcedef",
"forceref",
"ignorefunc",
"include",
"include-once",
"NoTrayIcon",
"OnAutoItStartRegister",
"pragma",
"Region",
"RequireAdmin",
"Tidy_Off",
"Tidy_On",
"Tidy_Parameters"
];
const LITERAL = 'True False And Null Not Or Default';
const BUILT_IN
= 'Abs ACos AdlibRegister AdlibUnRegister Asc AscW ASin Assign ATan AutoItSetOption AutoItWinGetTitle AutoItWinSetTitle Beep Binary BinaryLen BinaryMid BinaryToString BitAND BitNOT BitOR BitRotate BitShift BitXOR BlockInput Break Call CDTray Ceiling Chr ChrW ClipGet ClipPut ConsoleRead ConsoleWrite ConsoleWriteError ControlClick ControlCommand ControlDisable ControlEnable ControlFocus ControlGetFocus ControlGetHandle ControlGetPos ControlGetText ControlHide ControlListView ControlMove ControlSend ControlSetText ControlShow ControlTreeView Cos Dec DirCopy DirCreate DirGetSize DirMove DirRemove DllCall DllCallAddress DllCallbackFree DllCallbackGetPtr DllCallbackRegister DllClose DllOpen DllStructCreate DllStructGetData DllStructGetPtr DllStructGetSize DllStructSetData DriveGetDrive DriveGetFileSystem DriveGetLabel DriveGetSerial DriveGetType DriveMapAdd DriveMapDel DriveMapGet DriveSetLabel DriveSpaceFree DriveSpaceTotal DriveStatus EnvGet EnvSet EnvUpdate Eval Execute Exp FileChangeDir FileClose FileCopy FileCreateNTFSLink FileCreateShortcut FileDelete FileExists FileFindFirstFile FileFindNextFile FileFlush FileGetAttrib FileGetEncoding FileGetLongName FileGetPos FileGetShortcut FileGetShortName FileGetSize FileGetTime FileGetVersion FileInstall FileMove FileOpen FileOpenDialog FileRead FileReadLine FileReadToArray FileRecycle FileRecycleEmpty FileSaveDialog FileSelectFolder FileSetAttrib FileSetEnd FileSetPos FileSetTime FileWrite FileWriteLine Floor FtpSetProxy FuncName GUICreate GUICtrlCreateAvi GUICtrlCreateButton GUICtrlCreateCheckbox GUICtrlCreateCombo GUICtrlCreateContextMenu GUICtrlCreateDate GUICtrlCreateDummy GUICtrlCreateEdit GUICtrlCreateGraphic GUICtrlCreateGroup GUICtrlCreateIcon GUICtrlCreateInput GUICtrlCreateLabel GUICtrlCreateList GUICtrlCreateListView GUICtrlCreateListViewItem GUICtrlCreateMenu GUICtrlCreateMenuItem GUICtrlCreateMonthCal GUICtrlCreateObj GUICtrlCreatePic GUICtrlCreateProgress GUICtrlCreateRadio GUICtrlCreateSlider GUICtrlCreateTab GUICtrlCreateTabItem GUICtrlCreateTreeView GUICtrlCreateTreeViewItem GUICtrlCreateUpdown GUICtrlDelete GUICtrlGetHandle GUICtrlGetState GUICtrlRead GUICtrlRecvMsg GUICtrlRegisterListViewSort GUICtrlSendMsg GUICtrlSendToDummy GUICtrlSetBkColor GUICtrlSetColor GUICtrlSetCursor GUICtrlSetData GUICtrlSetDefBkColor GUICtrlSetDefColor GUICtrlSetFont GUICtrlSetGraphic GUICtrlSetImage GUICtrlSetLimit GUICtrlSetOnEvent GUICtrlSetPos GUICtrlSetResizing GUICtrlSetState GUICtrlSetStyle GUICtrlSetTip GUIDelete GUIGetCursorInfo GUIGetMsg GUIGetStyle GUIRegisterMsg GUISetAccelerators GUISetBkColor GUISetCoord GUISetCursor GUISetFont GUISetHelp GUISetIcon GUISetOnEvent GUISetState GUISetStyle GUIStartGroup GUISwitch Hex HotKeySet HttpSetProxy HttpSetUserAgent HWnd InetClose InetGet InetGetInfo InetGetSize InetRead IniDelete IniRead IniReadSection IniReadSectionNames IniRenameSection IniWrite IniWriteSection InputBox Int IsAdmin IsArray IsBinary IsBool IsDeclared IsDllStruct IsFloat IsFunc IsHWnd IsInt IsKeyword IsNumber IsObj IsPtr IsString Log MemGetStats Mod MouseClick MouseClickDrag MouseDown MouseGetCursor MouseGetPos MouseMove MouseUp MouseWheel MsgBox Number ObjCreate ObjCreateInterface ObjEvent ObjGet ObjName OnAutoItExitRegister OnAutoItExitUnRegister Ping PixelChecksum PixelGetColor PixelSearch ProcessClose ProcessExists ProcessGetStats ProcessList ProcessSetPriority ProcessWait ProcessWaitClose ProgressOff ProgressOn ProgressSet Ptr Random RegDelete RegEnumKey RegEnumVal RegRead RegWrite Round Run RunAs RunAsWait RunWait Send SendKeepActive SetError SetExtended ShellExecute ShellExecuteWait Shutdown Sin Sleep SoundPlay SoundSetWaveVolume SplashImageOn SplashOff SplashTextOn Sqrt SRandom StatusbarGetText StderrRead StdinWrite StdioClose StdoutRead String StringAddCR StringCompare StringFormat StringFromASCIIArray StringInStr StringIsAlNum StringIsAlpha StringIsASCII StringIsDigit StringIsFloat StringIsInt StringIsLower StringIsSpace StringIsUpper StringIsXDigit StringLeft StringLen StringLower StringMid StringRegExp StringRegExpReplace StringReplace StringReverse StringRight StringSplit StringStripCR StringStripWS StringToASCIIArray StringToBinary StringTrimLeft StringTrimRight StringUpper Tan TCPAccept TCPCloseSocket TCPConnect TCPListen TCPNameToIP TCPRecv TCPSend TCPShutdown, UDPShutdown TCPStartup, UDPStartup TimerDiff TimerInit ToolTip TrayCreateItem TrayCreateMenu TrayGetMsg TrayItemDelete TrayItemGetHandle TrayItemGetState TrayItemGetText TrayItemSetOnEvent TrayItemSetState TrayItemSetText TraySetClick TraySetIcon TraySetOnEvent TraySetPauseIcon TraySetState TraySetToolTip TrayTip UBound UDPBind UDPCloseSocket UDPOpen UDPRecv UDPSend VarGetType WinActivate WinActive WinClose WinExists WinFlash WinGetCaretPos WinGetClassList WinGetClientSize WinGetHandle WinGetPos WinGetProcess WinGetState WinGetText WinGetTitle WinKill WinList WinMenuSelectItem WinMinimizeAll WinMinimizeAllUndo WinMove WinSetOnTop WinSetState WinSetTitle WinSetTrans WinWait WinWaitActive WinWaitClose WinWaitNotActive';
const COMMENT = {
variants: [
hljs.COMMENT(';', '$', {
relevance: 0
}),
hljs.COMMENT('#cs', '#ce'),
hljs.COMMENT('#comments-start', '#comments-end')
]
};
const VARIABLE = {
begin: '\\$[A-z0-9_]+'
};
const STRING = {
className: 'string',
variants: [
{
begin: /"/,
end: /"/,
contains: [{
begin: /""/,
relevance: 0
}]
},
{
begin: /'/,
end: /'/,
contains: [{
begin: /''/,
relevance: 0
}]
}
]
};
const NUMBER = {
variants: [
hljs.BINARY_NUMBER_MODE,
hljs.C_NUMBER_MODE
]
};
const PREPROCESSOR = {
className: 'meta',
begin: '#',
end: '$',
keywords: {
keyword: DIRECTIVES
},
contains: [
{
begin: /\\\n/,
relevance: 0
},
{
beginKeywords: 'include',
keywords: {
keyword: 'include'
},
end: '$',
contains: [
STRING,
{
className: 'string',
variants: [
{
begin: '<',
end: '>'
},
{
begin: /"/,
end: /"/,
contains: [{
begin: /""/,
relevance: 0
}]
},
{
begin: /'/,
end: /'/,
contains: [{
begin: /''/,
relevance: 0
}]
}
]
}
]
},
STRING,
COMMENT
]
};
const CONSTANT = {
className: 'symbol',
// begin: '@',
// end: '$',
// keywords: 'AppDataCommonDir AppDataDir AutoItExe AutoItPID AutoItVersion AutoItX64 COM_EventObj CommonFilesDir Compiled ComputerName ComSpec CPUArch CR CRLF DesktopCommonDir DesktopDepth DesktopDir DesktopHeight DesktopRefresh DesktopWidth DocumentsCommonDir error exitCode exitMethod extended FavoritesCommonDir FavoritesDir GUI_CtrlHandle GUI_CtrlId GUI_DragFile GUI_DragId GUI_DropId GUI_WinHandle HomeDrive HomePath HomeShare HotKeyPressed HOUR IPAddress1 IPAddress2 IPAddress3 IPAddress4 KBLayout LF LocalAppDataDir LogonDNSDomain LogonDomain LogonServer MDAY MIN MON MSEC MUILang MyDocumentsDir NumParams OSArch OSBuild OSLang OSServicePack OSType OSVersion ProgramFilesDir ProgramsCommonDir ProgramsDir ScriptDir ScriptFullPath ScriptLineNumber ScriptName SEC StartMenuCommonDir StartMenuDir StartupCommonDir StartupDir SW_DISABLE SW_ENABLE SW_HIDE SW_LOCK SW_MAXIMIZE SW_MINIMIZE SW_RESTORE SW_SHOW SW_SHOWDEFAULT SW_SHOWMAXIMIZED SW_SHOWMINIMIZED SW_SHOWMINNOACTIVE SW_SHOWNA SW_SHOWNOACTIVATE SW_SHOWNORMAL SW_UNLOCK SystemDir TAB TempDir TRAY_ID TrayIconFlashing TrayIconVisible UserName UserProfileDir WDAY WindowsDir WorkingDir YDAY YEAR',
// relevance: 5
begin: '@[A-z0-9_]+'
};
const FUNCTION = {
beginKeywords: 'Func',
end: '$',
illegal: '\\$|\\[|%',
contains: [
hljs.inherit(hljs.UNDERSCORE_TITLE_MODE, { className: "title.function" }),
{
className: 'params',
begin: '\\(',
end: '\\)',
contains: [
VARIABLE,
STRING,
NUMBER
]
}
]
};
return {
name: 'AutoIt',
case_insensitive: true,
illegal: /\/\*/,
keywords: {
keyword: KEYWORDS,
built_in: BUILT_IN,
literal: LITERAL
},
contains: [
COMMENT,
VARIABLE,
STRING,
NUMBER,
PREPROCESSOR,
CONSTANT,
FUNCTION
]
};
}
module.exports = autoit;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/avrasm.js":
/*!***********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/avrasm.js ***!
\***********************************************************/
/***/ ((module) => {
/*
Language: AVR Assembly
Author: Vladimir Ermakov
Category: assembler
Website: https://www.microchip.com/webdoc/avrassembler/avrassembler.wb_instruction_list.html
*/
/** @type LanguageFn */
function avrasm(hljs) {
return {
name: 'AVR Assembly',
case_insensitive: true,
keywords: {
$pattern: '\\.?' + hljs.IDENT_RE,
keyword:
/* mnemonic */
'adc add adiw and andi asr bclr bld brbc brbs brcc brcs break breq brge brhc brhs ' +
'brid brie brlo brlt brmi brne brpl brsh brtc brts brvc brvs bset bst call cbi cbr ' +
'clc clh cli cln clr cls clt clv clz com cp cpc cpi cpse dec eicall eijmp elpm eor ' +
'fmul fmuls fmulsu icall ijmp in inc jmp ld ldd ldi lds lpm lsl lsr mov movw mul ' +
'muls mulsu neg nop or ori out pop push rcall ret reti rjmp rol ror sbc sbr sbrc sbrs ' +
'sec seh sbi sbci sbic sbis sbiw sei sen ser ses set sev sez sleep spm st std sts sub ' +
'subi swap tst wdr',
built_in:
/* general purpose registers */
'r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 r16 r17 r18 r19 r20 r21 r22 ' +
'r23 r24 r25 r26 r27 r28 r29 r30 r31 x|0 xh xl y|0 yh yl z|0 zh zl ' +
/* IO Registers (ATMega128) */
'ucsr1c udr1 ucsr1a ucsr1b ubrr1l ubrr1h ucsr0c ubrr0h tccr3c tccr3a tccr3b tcnt3h ' +
'tcnt3l ocr3ah ocr3al ocr3bh ocr3bl ocr3ch ocr3cl icr3h icr3l etimsk etifr tccr1c ' +
'ocr1ch ocr1cl twcr twdr twar twsr twbr osccal xmcra xmcrb eicra spmcsr spmcr portg ' +
'ddrg ping portf ddrf sreg sph spl xdiv rampz eicrb eimsk gimsk gicr eifr gifr timsk ' +
'tifr mcucr mcucsr tccr0 tcnt0 ocr0 assr tccr1a tccr1b tcnt1h tcnt1l ocr1ah ocr1al ' +
'ocr1bh ocr1bl icr1h icr1l tccr2 tcnt2 ocr2 ocdr wdtcr sfior eearh eearl eedr eecr ' +
'porta ddra pina portb ddrb pinb portc ddrc pinc portd ddrd pind spdr spsr spcr udr0 ' +
'ucsr0a ucsr0b ubrr0l acsr admux adcsr adch adcl porte ddre pine pinf',
meta:
'.byte .cseg .db .def .device .dseg .dw .endmacro .equ .eseg .exit .include .list ' +
'.listmac .macro .nolist .org .set'
},
contains: [
hljs.C_BLOCK_COMMENT_MODE,
hljs.COMMENT(
';',
'$',
{
relevance: 0
}
),
hljs.C_NUMBER_MODE, // 0x..., decimal, float
hljs.BINARY_NUMBER_MODE, // 0b...
{
className: 'number',
begin: '\\b(\\$[a-zA-Z0-9]+|0o[0-7]+)' // $..., 0o...
},
hljs.QUOTE_STRING_MODE,
{
className: 'string',
begin: '\'',
end: '[^\\\\]\'',
illegal: '[^\\\\][^\']'
},
{
className: 'symbol',
begin: '^[A-Za-z0-9_.$]+:'
},
{
className: 'meta',
begin: '#',
end: '$'
},
{ // substitution within a macro
className: 'subst',
begin: '@[0-9]+'
}
]
};
}
module.exports = avrasm;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/awk.js":
/*!********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/awk.js ***!
\********************************************************/
/***/ ((module) => {
/*
Language: Awk
Author: Matthew Daly
Website: https://www.gnu.org/software/gawk/manual/gawk.html
Description: language definition for Awk scripts
*/
/** @type LanguageFn */
function awk(hljs) {
const VARIABLE = {
className: 'variable',
variants: [
{
begin: /\$[\w\d#@][\w\d_]*/
},
{
begin: /\$\{(.*?)\}/
}
]
};
const KEYWORDS = 'BEGIN END if else while do for in break continue delete next nextfile function func exit|10';
const STRING = {
className: 'string',
contains: [hljs.BACKSLASH_ESCAPE],
variants: [
{
begin: /(u|b)?r?'''/,
end: /'''/,
relevance: 10
},
{
begin: /(u|b)?r?"""/,
end: /"""/,
relevance: 10
},
{
begin: /(u|r|ur)'/,
end: /'/,
relevance: 10
},
{
begin: /(u|r|ur)"/,
end: /"/,
relevance: 10
},
{
begin: /(b|br)'/,
end: /'/
},
{
begin: /(b|br)"/,
end: /"/
},
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE
]
};
return {
name: 'Awk',
keywords: {
keyword: KEYWORDS
},
contains: [
VARIABLE,
STRING,
hljs.REGEXP_MODE,
hljs.HASH_COMMENT_MODE,
hljs.NUMBER_MODE
]
};
}
module.exports = awk;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/axapta.js":
/*!***********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/axapta.js ***!
\***********************************************************/
/***/ ((module) => {
/*
Language: Microsoft X++
Description: X++ is a language used in Microsoft Dynamics 365, Dynamics AX, and Axapta.
Author: Dmitri Roudakov
Website: https://dynamics.microsoft.com/en-us/ax-overview/
Category: enterprise
*/
/** @type LanguageFn */
function axapta(hljs) {
const BUILT_IN_KEYWORDS = [
'anytype',
'boolean',
'byte',
'char',
'container',
'date',
'double',
'enum',
'guid',
'int',
'int64',
'long',
'real',
'short',
'str',
'utcdatetime',
'var'
];
const LITERAL_KEYWORDS = [
'default',
'false',
'null',
'true'
];
const NORMAL_KEYWORDS = [
'abstract',
'as',
'asc',
'avg',
'break',
'breakpoint',
'by',
'byref',
'case',
'catch',
'changecompany',
'class',
'client',
'client',
'common',
'const',
'continue',
'count',
'crosscompany',
'delegate',
'delete_from',
'desc',
'display',
'div',
'do',
'edit',
'else',
'eventhandler',
'exists',
'extends',
'final',
'finally',
'firstfast',
'firstonly',
'firstonly1',
'firstonly10',
'firstonly100',
'firstonly1000',
'flush',
'for',
'forceliterals',
'forcenestedloop',
'forceplaceholders',
'forceselectorder',
'forupdate',
'from',
'generateonly',
'group',
'hint',
'if',
'implements',
'in',
'index',
'insert_recordset',
'interface',
'internal',
'is',
'join',
'like',
'maxof',
'minof',
'mod',
'namespace',
'new',
'next',
'nofetch',
'notexists',
'optimisticlock',
'order',
'outer',
'pessimisticlock',
'print',
'private',
'protected',
'public',
'readonly',
'repeatableread',
'retry',
'return',
'reverse',
'select',
'server',
'setting',
'static',
'sum',
'super',
'switch',
'this',
'throw',
'try',
'ttsabort',
'ttsbegin',
'ttscommit',
'unchecked',
'update_recordset',
'using',
'validtimestate',
'void',
'where',
'while'
];
const KEYWORDS = {
keyword: NORMAL_KEYWORDS,
built_in: BUILT_IN_KEYWORDS,
literal: LITERAL_KEYWORDS
};
return {
name: 'X++',
aliases: ['x++'],
keywords: KEYWORDS,
contains: [
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE,
hljs.C_NUMBER_MODE,
{
className: 'meta',
begin: '#',
end: '$'
},
{
className: 'class',
beginKeywords: 'class interface',
end: /\{/,
excludeEnd: true,
illegal: ':',
contains: [
{
beginKeywords: 'extends implements'
},
hljs.UNDERSCORE_TITLE_MODE
]
}
]
};
}
module.exports = axapta;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/bash.js":
/*!*********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/bash.js ***!
\*********************************************************/
/***/ ((module) => {
/*
Language: Bash
Author: vah
Contributrors: Benjamin Pannell
Website: https://www.gnu.org/software/bash/
Category: common
*/
/** @type LanguageFn */
function bash(hljs) {
const regex = hljs.regex;
const VAR = {};
const BRACED_VAR = {
begin: /\$\{/,
end:/\}/,
contains: [
"self",
{
begin: /:-/,
contains: [ VAR ]
} // default values
]
};
Object.assign(VAR,{
className: 'variable',
variants: [
{begin: regex.concat(/\$[\w\d#@][\w\d_]*/,
// negative look-ahead tries to avoid matching patterns that are not
// Perl at all like $ident$, @ident@, etc.
`(?![\\w\\d])(?![$])`) },
BRACED_VAR
]
});
const SUBST = {
className: 'subst',
begin: /\$\(/, end: /\)/,
contains: [hljs.BACKSLASH_ESCAPE]
};
const HERE_DOC = {
begin: /<<-?\s*(?=\w+)/,
starts: {
contains: [
hljs.END_SAME_AS_BEGIN({
begin: /(\w+)/,
end: /(\w+)/,
className: 'string'
})
]
}
};
const QUOTE_STRING = {
className: 'string',
begin: /"/, end: /"/,
contains: [
hljs.BACKSLASH_ESCAPE,
VAR,
SUBST
]
};
SUBST.contains.push(QUOTE_STRING);
const ESCAPED_QUOTE = {
className: '',
begin: /\\"/
};
const APOS_STRING = {
className: 'string',
begin: /'/, end: /'/
};
const ARITHMETIC = {
begin: /\$\(\(/,
end: /\)\)/,
contains: [
{ begin: /\d+#[0-9a-f]+/, className: "number" },
hljs.NUMBER_MODE,
VAR
]
};
const SH_LIKE_SHELLS = [
"fish",
"bash",
"zsh",
"sh",
"csh",
"ksh",
"tcsh",
"dash",
"scsh",
];
const KNOWN_SHEBANG = hljs.SHEBANG({
binary: `(${SH_LIKE_SHELLS.join("|")})`,
relevance: 10
});
const FUNCTION = {
className: 'function',
begin: /\w[\w\d_]*\s*\(\s*\)\s*\{/,
returnBegin: true,
contains: [hljs.inherit(hljs.TITLE_MODE, {begin: /\w[\w\d_]*/})],
relevance: 0
};
const KEYWORDS = [
"if",
"then",
"else",
"elif",
"fi",
"for",
"while",
"in",
"do",
"done",
"case",
"esac",
"function"
];
const LITERALS = [
"true",
"false"
];
// to consume paths to prevent keyword matches inside them
const PATH_MODE = {
match: /(\/[a-z._-]+)+/
};
// http://www.gnu.org/software/bash/manual/html_node/Shell-Builtin-Commands.html
const SHELL_BUILT_INS = [
"break",
"cd",
"continue",
"eval",
"exec",
"exit",
"export",
"getopts",
"hash",
"pwd",
"readonly",
"return",
"shift",
"test",
"times",
"trap",
"umask",
"unset"
];
const BASH_BUILT_INS = [
"alias",
"bind",
"builtin",
"caller",
"command",
"declare",
"echo",
"enable",
"help",
"let",
"local",
"logout",
"mapfile",
"printf",
"read",
"readarray",
"source",
"type",
"typeset",
"ulimit",
"unalias"
];
const ZSH_BUILT_INS = [
"autoload",
"bg",
"bindkey",
"bye",
"cap",
"chdir",
"clone",
"comparguments",
"compcall",
"compctl",
"compdescribe",
"compfiles",
"compgroups",
"compquote",
"comptags",
"comptry",
"compvalues",
"dirs",
"disable",
"disown",
"echotc",
"echoti",
"emulate",
"fc",
"fg",
"float",
"functions",
"getcap",
"getln",
"history",
"integer",
"jobs",
"kill",
"limit",
"log",
"noglob",
"popd",
"print",
"pushd",
"pushln",
"rehash",
"sched",
"setcap",
"setopt",
"stat",
"suspend",
"ttyctl",
"unfunction",
"unhash",
"unlimit",
"unsetopt",
"vared",
"wait",
"whence",
"where",
"which",
"zcompile",
"zformat",
"zftp",
"zle",
"zmodload",
"zparseopts",
"zprof",
"zpty",
"zregexparse",
"zsocket",
"zstyle",
"ztcp"
];
const GNU_CORE_UTILS = [
"chcon",
"chgrp",
"chown",
"chmod",
"cp",
"dd",
"df",
"dir",
"dircolors",
"ln",
"ls",
"mkdir",
"mkfifo",
"mknod",
"mktemp",
"mv",
"realpath",
"rm",
"rmdir",
"shred",
"sync",
"touch",
"truncate",
"vdir",
"b2sum",
"base32",
"base64",
"cat",
"cksum",
"comm",
"csplit",
"cut",
"expand",
"fmt",
"fold",
"head",
"join",
"md5sum",
"nl",
"numfmt",
"od",
"paste",
"ptx",
"pr",
"sha1sum",
"sha224sum",
"sha256sum",
"sha384sum",
"sha512sum",
"shuf",
"sort",
"split",
"sum",
"tac",
"tail",
"tr",
"tsort",
"unexpand",
"uniq",
"wc",
"arch",
"basename",
"chroot",
"date",
"dirname",
"du",
"echo",
"env",
"expr",
"factor",
// "false", // keyword literal already
"groups",
"hostid",
"id",
"link",
"logname",
"nice",
"nohup",
"nproc",
"pathchk",
"pinky",
"printenv",
"printf",
"pwd",
"readlink",
"runcon",
"seq",
"sleep",
"stat",
"stdbuf",
"stty",
"tee",
"test",
"timeout",
// "true", // keyword literal already
"tty",
"uname",
"unlink",
"uptime",
"users",
"who",
"whoami",
"yes"
];
return {
name: 'Bash',
aliases: ['sh'],
keywords: {
$pattern: /\b[a-z._-]+\b/,
keyword: KEYWORDS,
literal: LITERALS,
built_in:[
...SHELL_BUILT_INS,
...BASH_BUILT_INS,
// Shell modifiers
"set",
"shopt",
...ZSH_BUILT_INS,
...GNU_CORE_UTILS
]
},
contains: [
KNOWN_SHEBANG, // to catch known shells and boost relevancy
hljs.SHEBANG(), // to catch unknown shells but still highlight the shebang
FUNCTION,
ARITHMETIC,
hljs.HASH_COMMENT_MODE,
HERE_DOC,
PATH_MODE,
QUOTE_STRING,
ESCAPED_QUOTE,
APOS_STRING,
VAR
]
};
}
module.exports = bash;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/basic.js":
/*!**********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/basic.js ***!
\**********************************************************/
/***/ ((module) => {
/*
Language: BASIC
Author: Raphaël Assénat
Description: Based on the BASIC reference from the Tandy 1000 guide
Website: https://en.wikipedia.org/wiki/Tandy_1000
*/
/** @type LanguageFn */
function basic(hljs) {
const KEYWORDS = [
"ABS",
"ASC",
"AND",
"ATN",
"AUTO|0",
"BEEP",
"BLOAD|10",
"BSAVE|10",
"CALL",
"CALLS",
"CDBL",
"CHAIN",
"CHDIR",
"CHR$|10",
"CINT",
"CIRCLE",
"CLEAR",
"CLOSE",
"CLS",
"COLOR",
"COM",
"COMMON",
"CONT",
"COS",
"CSNG",
"CSRLIN",
"CVD",
"CVI",
"CVS",
"DATA",
"DATE$",
"DEFDBL",
"DEFINT",
"DEFSNG",
"DEFSTR",
"DEF|0",
"SEG",
"USR",
"DELETE",
"DIM",
"DRAW",
"EDIT",
"END",
"ENVIRON",
"ENVIRON$",
"EOF",
"EQV",
"ERASE",
"ERDEV",
"ERDEV$",
"ERL",
"ERR",
"ERROR",
"EXP",
"FIELD",
"FILES",
"FIX",
"FOR|0",
"FRE",
"GET",
"GOSUB|10",
"GOTO",
"HEX$",
"IF",
"THEN",
"ELSE|0",
"INKEY$",
"INP",
"INPUT",
"INPUT#",
"INPUT$",
"INSTR",
"IMP",
"INT",
"IOCTL",
"IOCTL$",
"KEY",
"ON",
"OFF",
"LIST",
"KILL",
"LEFT$",
"LEN",
"LET",
"LINE",
"LLIST",
"LOAD",
"LOC",
"LOCATE",
"LOF",
"LOG",
"LPRINT",
"USING",
"LSET",
"MERGE",
"MID$",
"MKDIR",
"MKD$",
"MKI$",
"MKS$",
"MOD",
"NAME",
"NEW",
"NEXT",
"NOISE",
"NOT",
"OCT$",
"ON",
"OR",
"PEN",
"PLAY",
"STRIG",
"OPEN",
"OPTION",
"BASE",
"OUT",
"PAINT",
"PALETTE",
"PCOPY",
"PEEK",
"PMAP",
"POINT",
"POKE",
"POS",
"PRINT",
"PRINT]",
"PSET",
"PRESET",
"PUT",
"RANDOMIZE",
"READ",
"REM",
"RENUM",
"RESET|0",
"RESTORE",
"RESUME",
"RETURN|0",
"RIGHT$",
"RMDIR",
"RND",
"RSET",
"RUN",
"SAVE",
"SCREEN",
"SGN",
"SHELL",
"SIN",
"SOUND",
"SPACE$",
"SPC",
"SQR",
"STEP",
"STICK",
"STOP",
"STR$",
"STRING$",
"SWAP",
"SYSTEM",
"TAB",
"TAN",
"TIME$",
"TIMER",
"TROFF",
"TRON",
"TO",
"USR",
"VAL",
"VARPTR",
"VARPTR$",
"VIEW",
"WAIT",
"WHILE",
"WEND",
"WIDTH",
"WINDOW",
"WRITE",
"XOR"
];
return {
name: 'BASIC',
case_insensitive: true,
illegal: '^\.',
// Support explicitly typed variables that end with $%! or #.
keywords: {
$pattern: '[a-zA-Z][a-zA-Z0-9_$%!#]*',
keyword: KEYWORDS
},
contains: [
hljs.QUOTE_STRING_MODE,
hljs.COMMENT('REM', '$', {
relevance: 10
}),
hljs.COMMENT('\'', '$', {
relevance: 0
}),
{
// Match line numbers
className: 'symbol',
begin: '^[0-9]+ ',
relevance: 10
},
{
// Match typed numeric constants (1000, 12.34!, 1.2e5, 1.5#, 1.2D2)
className: 'number',
begin: '\\b\\d+(\\.\\d+)?([edED]\\d+)?[#\!]?',
relevance: 0
},
{
// Match hexadecimal numbers (&Hxxxx)
className: 'number',
begin: '(&[hH][0-9a-fA-F]{1,4})'
},
{
// Match octal numbers (&Oxxxxxx)
className: 'number',
begin: '(&[oO][0-7]{1,6})'
}
]
};
}
module.exports = basic;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/bnf.js":
/*!********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/bnf.js ***!
\********************************************************/
/***/ ((module) => {
/*
Language: Backus–Naur Form
Website: https://en.wikipedia.org/wiki/Backus–Naur_form
Author: Oleg Efimov
*/
/** @type LanguageFn */
function bnf(hljs) {
return {
name: 'Backus–Naur Form',
contains: [
// Attribute
{
className: 'attribute',
begin: /,
end: />/
},
// Specific
{
begin: /::=/,
end: /$/,
contains: [
{
begin: /,
end: />/
},
// Common
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE
]
}
]
};
}
module.exports = bnf;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/brainfuck.js":
/*!**************************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/brainfuck.js ***!
\**************************************************************/
/***/ ((module) => {
/*
Language: Brainfuck
Author: Evgeny Stepanischev
Website: https://esolangs.org/wiki/Brainfuck
*/
/** @type LanguageFn */
function brainfuck(hljs) {
const LITERAL = {
className: 'literal',
begin: /[+-]/,
relevance: 0
};
return {
name: 'Brainfuck',
aliases: ['bf'],
contains: [
hljs.COMMENT(
'[^\\[\\]\\.,\\+\\-<> \r\n]',
'[\\[\\]\\.,\\+\\-<> \r\n]',
{
returnEnd: true,
relevance: 0
}
),
{
className: 'title',
begin: '[\\[\\]]',
relevance: 0
},
{
className: 'string',
begin: '[\\.,]',
relevance: 0
},
{
// this mode works as the only relevance counter
begin: /(?:\+\+|--)/,
contains: [LITERAL]
},
LITERAL
]
};
}
module.exports = brainfuck;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/c.js":
/*!******************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/c.js ***!
\******************************************************/
/***/ ((module) => {
/*
Language: C
Category: common, system
Website: https://en.wikipedia.org/wiki/C_(programming_language)
*/
/** @type LanguageFn */
function c(hljs) {
const regex = hljs.regex;
// added for historic reasons because `hljs.C_LINE_COMMENT_MODE` does
// not include such support nor can we be sure all the grammars depending
// on it would desire this behavior
const C_LINE_COMMENT_MODE = hljs.COMMENT('//', '$', {
contains: [
{
begin: /\\\n/
}
]
});
const DECLTYPE_AUTO_RE = 'decltype\\(auto\\)';
const NAMESPACE_RE = '[a-zA-Z_]\\w*::';
const TEMPLATE_ARGUMENT_RE = '<[^<>]+>';
const FUNCTION_TYPE_RE = '(' +
DECLTYPE_AUTO_RE + '|' +
regex.optional(NAMESPACE_RE) +
'[a-zA-Z_]\\w*' + regex.optional(TEMPLATE_ARGUMENT_RE) +
')';
const TYPES = {
className: 'type',
variants: [
{ begin: '\\b[a-z\\d_]*_t\\b' },
{ match: /\batomic_[a-z]{3,6}\b/}
]
};
// https://en.cppreference.com/w/cpp/language/escape
// \\ \x \xFF \u2837 \u00323747 \374
const CHARACTER_ESCAPES = '\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)';
const STRINGS = {
className: 'string',
variants: [
{
begin: '(u8?|U|L)?"',
end: '"',
illegal: '\\n',
contains: [ hljs.BACKSLASH_ESCAPE ]
},
{
begin: '(u8?|U|L)?\'(' + CHARACTER_ESCAPES + "|.)",
end: '\'',
illegal: '.'
},
hljs.END_SAME_AS_BEGIN({
begin: /(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,
end: /\)([^()\\ ]{0,16})"/
})
]
};
const NUMBERS = {
className: 'number',
variants: [
{
begin: '\\b(0b[01\']+)'
},
{
begin: '(-?)\\b([\\d\']+(\\.[\\d\']*)?|\\.[\\d\']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)'
},
{
begin: '(-?)(\\b0[xX][a-fA-F0-9\']+|(\\b[\\d\']+(\\.[\\d\']*)?|\\.[\\d\']+)([eE][-+]?[\\d\']+)?)'
}
],
relevance: 0
};
const PREPROCESSOR = {
className: 'meta',
begin: /#\s*[a-z]+\b/,
end: /$/,
keywords: {
keyword:
'if else elif endif define undef warning error line ' +
'pragma _Pragma ifdef ifndef include'
},
contains: [
{
begin: /\\\n/,
relevance: 0
},
hljs.inherit(STRINGS, {
className: 'string'
}),
{
className: 'string',
begin: /<.*?>/
},
C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE
]
};
const TITLE_MODE = {
className: 'title',
begin: regex.optional(NAMESPACE_RE) + hljs.IDENT_RE,
relevance: 0
};
const FUNCTION_TITLE = regex.optional(NAMESPACE_RE) + hljs.IDENT_RE + '\\s*\\(';
const C_KEYWORDS = [
"asm",
"auto",
"break",
"case",
"continue",
"default",
"do",
"else",
"enum",
"extern",
"for",
"fortran",
"goto",
"if",
"inline",
"register",
"restrict",
"return",
"sizeof",
"struct",
"switch",
"typedef",
"union",
"volatile",
"while",
"_Alignas",
"_Alignof",
"_Atomic",
"_Generic",
"_Noreturn",
"_Static_assert",
"_Thread_local",
// aliases
"alignas",
"alignof",
"noreturn",
"static_assert",
"thread_local",
// not a C keyword but is, for all intents and purposes, treated exactly like one.
"_Pragma"
];
const C_TYPES = [
"float",
"double",
"signed",
"unsigned",
"int",
"short",
"long",
"char",
"void",
"_Bool",
"_Complex",
"_Imaginary",
"_Decimal32",
"_Decimal64",
"_Decimal128",
// modifiers
"const",
"static",
// aliases
"complex",
"bool",
"imaginary"
];
const KEYWORDS = {
keyword: C_KEYWORDS,
type: C_TYPES,
literal: 'true false NULL',
// TODO: apply hinting work similar to what was done in cpp.js
built_in: 'std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream ' +
'auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set ' +
'unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos ' +
'asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp ' +
'fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper ' +
'isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow ' +
'printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp ' +
'strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan ' +
'vfprintf vprintf vsprintf endl initializer_list unique_ptr',
};
const EXPRESSION_CONTAINS = [
PREPROCESSOR,
TYPES,
C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
NUMBERS,
STRINGS
];
const EXPRESSION_CONTEXT = {
// This mode covers expression context where we can't expect a function
// definition and shouldn't highlight anything that looks like one:
// `return some()`, `else if()`, `(x*sum(1, 2))`
variants: [
{
begin: /=/,
end: /;/
},
{
begin: /\(/,
end: /\)/
},
{
beginKeywords: 'new throw return else',
end: /;/
}
],
keywords: KEYWORDS,
contains: EXPRESSION_CONTAINS.concat([
{
begin: /\(/,
end: /\)/,
keywords: KEYWORDS,
contains: EXPRESSION_CONTAINS.concat([ 'self' ]),
relevance: 0
}
]),
relevance: 0
};
const FUNCTION_DECLARATION = {
begin: '(' + FUNCTION_TYPE_RE + '[\\*&\\s]+)+' + FUNCTION_TITLE,
returnBegin: true,
end: /[{;=]/,
excludeEnd: true,
keywords: KEYWORDS,
illegal: /[^\w\s\*&:<>.]/,
contains: [
{ // to prevent it from being confused as the function title
begin: DECLTYPE_AUTO_RE,
keywords: KEYWORDS,
relevance: 0
},
{
begin: FUNCTION_TITLE,
returnBegin: true,
contains: [
hljs.inherit(TITLE_MODE, { className: "title.function" })
],
relevance: 0
},
// allow for multiple declarations, e.g.:
// extern void f(int), g(char);
{
relevance: 0,
match: /,/
},
{
className: 'params',
begin: /\(/,
end: /\)/,
keywords: KEYWORDS,
relevance: 0,
contains: [
C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
STRINGS,
NUMBERS,
TYPES,
// Count matching parentheses.
{
begin: /\(/,
end: /\)/,
keywords: KEYWORDS,
relevance: 0,
contains: [
'self',
C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
STRINGS,
NUMBERS,
TYPES
]
}
]
},
TYPES,
C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
PREPROCESSOR
]
};
return {
name: "C",
aliases: [
'h'
],
keywords: KEYWORDS,
// Until differentiations are added between `c` and `cpp`, `c` will
// not be auto-detected to avoid auto-detect conflicts between C and C++
disableAutodetect: true,
illegal: '',
contains: [].concat(
EXPRESSION_CONTEXT,
FUNCTION_DECLARATION,
EXPRESSION_CONTAINS,
[
PREPROCESSOR,
{
begin: hljs.IDENT_RE + '::',
keywords: KEYWORDS
},
{
className: 'class',
beginKeywords: 'enum class struct union',
end: /[{;:<>=]/,
contains: [
{
beginKeywords: "final class struct"
},
hljs.TITLE_MODE
]
}
]),
exports: {
preprocessor: PREPROCESSOR,
strings: STRINGS,
keywords: KEYWORDS
}
};
}
module.exports = c;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/cal.js":
/*!********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/cal.js ***!
\********************************************************/
/***/ ((module) => {
/*
Language: C/AL
Author: Kenneth Fuglsang Christensen
Description: Provides highlighting of Microsoft Dynamics NAV C/AL code files
Website: https://docs.microsoft.com/en-us/dynamics-nav/programming-in-c-al
*/
/** @type LanguageFn */
function cal(hljs) {
const KEYWORDS =
'div mod in and or not xor asserterror begin case do downto else end exit for if of repeat then to ' +
'until while with var';
const LITERALS = 'false true';
const COMMENT_MODES = [
hljs.C_LINE_COMMENT_MODE,
hljs.COMMENT(
/\{/,
/\}/,
{
relevance: 0
}
),
hljs.COMMENT(
/\(\*/,
/\*\)/,
{
relevance: 10
}
)
];
const STRING = {
className: 'string',
begin: /'/,
end: /'/,
contains: [{
begin: /''/
}]
};
const CHAR_STRING = {
className: 'string',
begin: /(#\d+)+/
};
const DATE = {
className: 'number',
begin: '\\b\\d+(\\.\\d+)?(DT|D|T)',
relevance: 0
};
const DBL_QUOTED_VARIABLE = {
className: 'string', // not a string technically but makes sense to be highlighted in the same style
begin: '"',
end: '"'
};
const PROCEDURE = {
className: 'function',
beginKeywords: 'procedure',
end: /[:;]/,
keywords: 'procedure|10',
contains: [
hljs.TITLE_MODE,
{
className: 'params',
begin: /\(/,
end: /\)/,
keywords: KEYWORDS,
contains: [
STRING,
CHAR_STRING
]
}
].concat(COMMENT_MODES)
};
const OBJECT = {
className: 'class',
begin: 'OBJECT (Table|Form|Report|Dataport|Codeunit|XMLport|MenuSuite|Page|Query) (\\d+) ([^\\r\\n]+)',
returnBegin: true,
contains: [
hljs.TITLE_MODE,
PROCEDURE
]
};
return {
name: 'C/AL',
case_insensitive: true,
keywords: {
keyword: KEYWORDS,
literal: LITERALS
},
illegal: /\/\*/,
contains: [
STRING,
CHAR_STRING,
DATE,
DBL_QUOTED_VARIABLE,
hljs.NUMBER_MODE,
OBJECT,
PROCEDURE
]
};
}
module.exports = cal;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/capnproto.js":
/*!**************************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/capnproto.js ***!
\**************************************************************/
/***/ ((module) => {
/*
Language: Cap’n Proto
Author: Oleg Efimov
Description: Cap’n Proto message definition format
Website: https://capnproto.org/capnp-tool.html
Category: protocols
*/
/** @type LanguageFn */
function capnproto(hljs) {
const KEYWORDS = [
"struct",
"enum",
"interface",
"union",
"group",
"import",
"using",
"const",
"annotation",
"extends",
"in",
"of",
"on",
"as",
"with",
"from",
"fixed"
];
const BUILT_INS = [
"Void",
"Bool",
"Int8",
"Int16",
"Int32",
"Int64",
"UInt8",
"UInt16",
"UInt32",
"UInt64",
"Float32",
"Float64",
"Text",
"Data",
"AnyPointer",
"AnyStruct",
"Capability",
"List"
];
const LITERALS = [
"true",
"false"
];
return {
name: 'Cap’n Proto',
aliases: ['capnp'],
keywords: {
keyword: KEYWORDS,
built_in: BUILT_INS,
literal: LITERALS
},
contains: [
hljs.QUOTE_STRING_MODE,
hljs.NUMBER_MODE,
hljs.HASH_COMMENT_MODE,
{
className: 'meta',
begin: /@0x[\w\d]{16};/,
illegal: /\n/
},
{
className: 'symbol',
begin: /@\d+\b/
},
{
className: 'class',
beginKeywords: 'struct enum',
end: /\{/,
illegal: /\n/,
contains: [hljs.inherit(hljs.TITLE_MODE, {
starts: {
endsWithParent: true,
excludeEnd: true
} // hack: eating everything after the first title
})]
},
{
className: 'class',
beginKeywords: 'interface',
end: /\{/,
illegal: /\n/,
contains: [hljs.inherit(hljs.TITLE_MODE, {
starts: {
endsWithParent: true,
excludeEnd: true
} // hack: eating everything after the first title
})]
}
]
};
}
module.exports = capnproto;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/ceylon.js":
/*!***********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/ceylon.js ***!
\***********************************************************/
/***/ ((module) => {
/*
Language: Ceylon
Author: Lucas Werkmeister
Website: https://ceylon-lang.org
*/
/** @type LanguageFn */
function ceylon(hljs) {
// 2.3. Identifiers and keywords
const KEYWORDS = [
"assembly",
"module",
"package",
"import",
"alias",
"class",
"interface",
"object",
"given",
"value",
"assign",
"void",
"function",
"new",
"of",
"extends",
"satisfies",
"abstracts",
"in",
"out",
"return",
"break",
"continue",
"throw",
"assert",
"dynamic",
"if",
"else",
"switch",
"case",
"for",
"while",
"try",
"catch",
"finally",
"then",
"let",
"this",
"outer",
"super",
"is",
"exists",
"nonempty"
];
// 7.4.1 Declaration Modifiers
const DECLARATION_MODIFIERS = [
"shared",
"abstract",
"formal",
"default",
"actual",
"variable",
"late",
"native",
"deprecated",
"final",
"sealed",
"annotation",
"suppressWarnings",
"small"
];
// 7.4.2 Documentation
const DOCUMENTATION = [
"doc",
"by",
"license",
"see",
"throws",
"tagged"
];
const SUBST = {
className: 'subst',
excludeBegin: true,
excludeEnd: true,
begin: /``/,
end: /``/,
keywords: KEYWORDS,
relevance: 10
};
const EXPRESSIONS = [
{
// verbatim string
className: 'string',
begin: '"""',
end: '"""',
relevance: 10
},
{
// string literal or template
className: 'string',
begin: '"',
end: '"',
contains: [SUBST]
},
{
// character literal
className: 'string',
begin: "'",
end: "'"
},
{
// numeric literal
className: 'number',
begin: '#[0-9a-fA-F_]+|\\$[01_]+|[0-9_]+(?:\\.[0-9_](?:[eE][+-]?\\d+)?)?[kMGTPmunpf]?',
relevance: 0
}
];
SUBST.contains = EXPRESSIONS;
return {
name: 'Ceylon',
keywords: {
keyword: KEYWORDS.concat(DECLARATION_MODIFIERS),
meta: DOCUMENTATION
},
illegal: '\\$[^01]|#[^0-9a-fA-F]',
contains: [
hljs.C_LINE_COMMENT_MODE,
hljs.COMMENT('/\\*', '\\*/', {
contains: ['self']
}),
{
// compiler annotation
className: 'meta',
begin: '@[a-z]\\w*(?::"[^"]*")?'
}
].concat(EXPRESSIONS)
};
}
module.exports = ceylon;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/clean.js":
/*!**********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/clean.js ***!
\**********************************************************/
/***/ ((module) => {
/*
Language: Clean
Author: Camil Staps
Category: functional
Website: http://clean.cs.ru.nl
*/
/** @type LanguageFn */
function clean(hljs) {
const KEYWORDS = [
"if",
"let",
"in",
"with",
"where",
"case",
"of",
"class",
"instance",
"otherwise",
"implementation",
"definition",
"system",
"module",
"from",
"import",
"qualified",
"as",
"special",
"code",
"inline",
"foreign",
"export",
"ccall",
"stdcall",
"generic",
"derive",
"infix",
"infixl",
"infixr"
];
return {
name: 'Clean',
aliases: [
'icl',
'dcl'
],
keywords: {
keyword: KEYWORDS,
built_in:
'Int Real Char Bool',
literal:
'True False'
},
contains: [
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE,
hljs.C_NUMBER_MODE,
{ // relevance booster
begin: '->|<-[|:]?|#!?|>>=|\\{\\||\\|\\}|:==|=:|<>'
}
]
};
}
module.exports = clean;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/clojure-repl.js":
/*!*****************************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/clojure-repl.js ***!
\*****************************************************************/
/***/ ((module) => {
/*
Language: Clojure REPL
Description: Clojure REPL sessions
Author: Ivan Sagalaev
Requires: clojure.js
Website: https://clojure.org
Category: lisp
*/
/** @type LanguageFn */
function clojureRepl(hljs) {
return {
name: 'Clojure REPL',
contains: [
{
className: 'meta',
begin: /^([\w.-]+|\s*#_)?=>/,
starts: {
end: /$/,
subLanguage: 'clojure'
}
}
]
};
}
module.exports = clojureRepl;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/clojure.js":
/*!************************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/clojure.js ***!
\************************************************************/
/***/ ((module) => {
/*
Language: Clojure
Description: Clojure syntax (based on lisp.js)
Author: mfornos
Website: https://clojure.org
Category: lisp
*/
/** @type LanguageFn */
function clojure(hljs) {
const SYMBOLSTART = 'a-zA-Z_\\-!.?+*=<>\'';
const SYMBOL_RE = '[' + SYMBOLSTART + '][' + SYMBOLSTART + '0-9/;:]*';
const globals = 'def defonce defprotocol defstruct defmulti defmethod defn- defn defmacro deftype defrecord';
const keywords = {
$pattern: SYMBOL_RE,
built_in:
// Clojure keywords
globals + ' ' +
'cond apply if-not if-let if not not= =|0 <|0 >|0 <=|0 >=|0 ==|0 +|0 /|0 *|0 -|0 rem ' +
'quot neg? pos? delay? symbol? keyword? true? false? integer? empty? coll? list? ' +
'set? ifn? fn? associative? sequential? sorted? counted? reversible? number? decimal? ' +
'class? distinct? isa? float? rational? reduced? ratio? odd? even? char? seq? vector? ' +
'string? map? nil? contains? zero? instance? not-every? not-any? libspec? -> ->> .. . ' +
'inc compare do dotimes mapcat take remove take-while drop letfn drop-last take-last ' +
'drop-while while intern condp case reduced cycle split-at split-with repeat replicate ' +
'iterate range merge zipmap declare line-seq sort comparator sort-by dorun doall nthnext ' +
'nthrest partition eval doseq await await-for let agent atom send send-off release-pending-sends ' +
'add-watch mapv filterv remove-watch agent-error restart-agent set-error-handler error-handler ' +
'set-error-mode! error-mode shutdown-agents quote var fn loop recur throw try monitor-enter ' +
'monitor-exit macroexpand macroexpand-1 for dosync and or ' +
'when when-not when-let comp juxt partial sequence memoize constantly complement identity assert ' +
'peek pop doto proxy first rest cons cast coll last butlast ' +
'sigs reify second ffirst fnext nfirst nnext meta with-meta ns in-ns create-ns import ' +
'refer keys select-keys vals key val rseq name namespace promise into transient persistent! conj! ' +
'assoc! dissoc! pop! disj! use class type num float double short byte boolean bigint biginteger ' +
'bigdec print-method print-dup throw-if printf format load compile get-in update-in pr pr-on newline ' +
'flush read slurp read-line subvec with-open memfn time re-find re-groups rand-int rand mod locking ' +
'assert-valid-fdecl alias resolve ref deref refset swap! reset! set-validator! compare-and-set! alter-meta! ' +
'reset-meta! commute get-validator alter ref-set ref-history-count ref-min-history ref-max-history ensure sync io! ' +
'new next conj set! to-array future future-call into-array aset gen-class reduce map filter find empty ' +
'hash-map hash-set sorted-map sorted-map-by sorted-set sorted-set-by vec vector seq flatten reverse assoc dissoc list ' +
'disj get union difference intersection extend extend-type extend-protocol int nth delay count concat chunk chunk-buffer ' +
'chunk-append chunk-first chunk-rest max min dec unchecked-inc-int unchecked-inc unchecked-dec-inc unchecked-dec unchecked-negate ' +
'unchecked-add-int unchecked-add unchecked-subtract-int unchecked-subtract chunk-next chunk-cons chunked-seq? prn vary-meta ' +
'lazy-seq spread list* str find-keyword keyword symbol gensym force rationalize'
};
const SIMPLE_NUMBER_RE = '[-+]?\\d+(\\.\\d+)?';
const SYMBOL = {
begin: SYMBOL_RE,
relevance: 0
};
const NUMBER = {
className: 'number',
begin: SIMPLE_NUMBER_RE,
relevance: 0
};
const STRING = hljs.inherit(hljs.QUOTE_STRING_MODE, {
illegal: null
});
const COMMENT = hljs.COMMENT(
';',
'$',
{
relevance: 0
}
);
const LITERAL = {
className: 'literal',
begin: /\b(true|false|nil)\b/
};
const COLLECTION = {
begin: '[\\[\\{]',
end: '[\\]\\}]',
relevance: 0
};
const HINT = {
className: 'comment',
begin: '\\^' + SYMBOL_RE
};
const HINT_COL = hljs.COMMENT('\\^\\{', '\\}');
const KEY = {
className: 'symbol',
begin: '[:]{1,2}' + SYMBOL_RE
};
const LIST = {
begin: '\\(',
end: '\\)'
};
const BODY = {
endsWithParent: true,
relevance: 0
};
const NAME = {
keywords: keywords,
className: 'name',
begin: SYMBOL_RE,
relevance: 0,
starts: BODY
};
const DEFAULT_CONTAINS = [
LIST,
STRING,
HINT,
HINT_COL,
COMMENT,
KEY,
COLLECTION,
NUMBER,
LITERAL,
SYMBOL
];
const GLOBAL = {
beginKeywords: globals,
keywords: {
$pattern: SYMBOL_RE,
keyword: globals
},
end: '(\\[|#|\\d|"|:|\\{|\\)|\\(|$)',
contains: [
{
className: 'title',
begin: SYMBOL_RE,
relevance: 0,
excludeEnd: true,
// we can only have a single title
endsParent: true
}
].concat(DEFAULT_CONTAINS)
};
LIST.contains = [
hljs.COMMENT('comment', ''),
GLOBAL,
NAME,
BODY
];
BODY.contains = DEFAULT_CONTAINS;
COLLECTION.contains = DEFAULT_CONTAINS;
HINT_COL.contains = [ COLLECTION ];
return {
name: 'Clojure',
aliases: [ 'clj', 'edn' ],
illegal: /\S/,
contains: [
LIST,
STRING,
HINT,
HINT_COL,
COMMENT,
KEY,
COLLECTION,
NUMBER,
LITERAL
]
};
}
module.exports = clojure;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/cmake.js":
/*!**********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/cmake.js ***!
\**********************************************************/
/***/ ((module) => {
/*
Language: CMake
Description: CMake is an open-source cross-platform system for build automation.
Author: Igor Kalnitsky
Website: https://cmake.org
*/
/** @type LanguageFn */
function cmake(hljs) {
return {
name: 'CMake',
aliases: ['cmake.in'],
case_insensitive: true,
keywords: {
keyword:
// scripting commands
'break cmake_host_system_information cmake_minimum_required cmake_parse_arguments ' +
'cmake_policy configure_file continue elseif else endforeach endfunction endif endmacro ' +
'endwhile execute_process file find_file find_library find_package find_path ' +
'find_program foreach function get_cmake_property get_directory_property ' +
'get_filename_component get_property if include include_guard list macro ' +
'mark_as_advanced math message option return separate_arguments ' +
'set_directory_properties set_property set site_name string unset variable_watch while ' +
// project commands
'add_compile_definitions add_compile_options add_custom_command add_custom_target ' +
'add_definitions add_dependencies add_executable add_library add_link_options ' +
'add_subdirectory add_test aux_source_directory build_command create_test_sourcelist ' +
'define_property enable_language enable_testing export fltk_wrap_ui ' +
'get_source_file_property get_target_property get_test_property include_directories ' +
'include_external_msproject include_regular_expression install link_directories ' +
'link_libraries load_cache project qt_wrap_cpp qt_wrap_ui remove_definitions ' +
'set_source_files_properties set_target_properties set_tests_properties source_group ' +
'target_compile_definitions target_compile_features target_compile_options ' +
'target_include_directories target_link_directories target_link_libraries ' +
'target_link_options target_sources try_compile try_run ' +
// CTest commands
'ctest_build ctest_configure ctest_coverage ctest_empty_binary_directory ctest_memcheck ' +
'ctest_read_custom_files ctest_run_script ctest_sleep ctest_start ctest_submit ' +
'ctest_test ctest_update ctest_upload ' +
// deprecated commands
'build_name exec_program export_library_dependencies install_files install_programs ' +
'install_targets load_command make_directory output_required_files remove ' +
'subdir_depends subdirs use_mangled_mesa utility_source variable_requires write_file ' +
'qt5_use_modules qt5_use_package qt5_wrap_cpp ' +
// core keywords
'on off true false and or not command policy target test exists is_newer_than ' +
'is_directory is_symlink is_absolute matches less greater equal less_equal ' +
'greater_equal strless strgreater strequal strless_equal strgreater_equal version_less ' +
'version_greater version_equal version_less_equal version_greater_equal in_list defined'
},
contains: [
{
className: 'variable',
begin: /\$\{/,
end: /\}/
},
hljs.HASH_COMMENT_MODE,
hljs.QUOTE_STRING_MODE,
hljs.NUMBER_MODE
]
};
}
module.exports = cmake;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/coffeescript.js":
/*!*****************************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/coffeescript.js ***!
\*****************************************************************/
/***/ ((module) => {
const KEYWORDS = [
"as", // for exports
"in",
"of",
"if",
"for",
"while",
"finally",
"var",
"new",
"function",
"do",
"return",
"void",
"else",
"break",
"catch",
"instanceof",
"with",
"throw",
"case",
"default",
"try",
"switch",
"continue",
"typeof",
"delete",
"let",
"yield",
"const",
"class",
// JS handles these with a special rule
// "get",
// "set",
"debugger",
"async",
"await",
"static",
"import",
"from",
"export",
"extends"
];
const LITERALS = [
"true",
"false",
"null",
"undefined",
"NaN",
"Infinity"
];
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects
const TYPES = [
// Fundamental objects
"Object",
"Function",
"Boolean",
"Symbol",
// numbers and dates
"Math",
"Date",
"Number",
"BigInt",
// text
"String",
"RegExp",
// Indexed collections
"Array",
"Float32Array",
"Float64Array",
"Int8Array",
"Uint8Array",
"Uint8ClampedArray",
"Int16Array",
"Int32Array",
"Uint16Array",
"Uint32Array",
"BigInt64Array",
"BigUint64Array",
// Keyed collections
"Set",
"Map",
"WeakSet",
"WeakMap",
// Structured data
"ArrayBuffer",
"SharedArrayBuffer",
"Atomics",
"DataView",
"JSON",
// Control abstraction objects
"Promise",
"Generator",
"GeneratorFunction",
"AsyncFunction",
// Reflection
"Reflect",
"Proxy",
// Internationalization
"Intl",
// WebAssembly
"WebAssembly"
];
const ERROR_TYPES = [
"Error",
"EvalError",
"InternalError",
"RangeError",
"ReferenceError",
"SyntaxError",
"TypeError",
"URIError"
];
const BUILT_IN_GLOBALS = [
"setInterval",
"setTimeout",
"clearInterval",
"clearTimeout",
"require",
"exports",
"eval",
"isFinite",
"isNaN",
"parseFloat",
"parseInt",
"decodeURI",
"decodeURIComponent",
"encodeURI",
"encodeURIComponent",
"escape",
"unescape"
];
const BUILT_INS = [].concat(
BUILT_IN_GLOBALS,
TYPES,
ERROR_TYPES
);
/*
Language: CoffeeScript
Author: Dmytrii Nagirniak
Contributors: Oleg Efimov , Cédric Néhémie
Description: CoffeeScript is a programming language that transcompiles to JavaScript. For info about language see http://coffeescript.org/
Category: scripting
Website: https://coffeescript.org
*/
/** @type LanguageFn */
function coffeescript(hljs) {
const COFFEE_BUILT_INS = [
'npm',
'print'
];
const COFFEE_LITERALS = [
'yes',
'no',
'on',
'off'
];
const COFFEE_KEYWORDS = [
'then',
'unless',
'until',
'loop',
'by',
'when',
'and',
'or',
'is',
'isnt',
'not'
];
const NOT_VALID_KEYWORDS = [
"var",
"const",
"let",
"function",
"static"
];
const excluding = (list) =>
(kw) => !list.includes(kw);
const KEYWORDS$1 = {
keyword: KEYWORDS.concat(COFFEE_KEYWORDS).filter(excluding(NOT_VALID_KEYWORDS)),
literal: LITERALS.concat(COFFEE_LITERALS),
built_in: BUILT_INS.concat(COFFEE_BUILT_INS)
};
const JS_IDENT_RE = '[A-Za-z$_][0-9A-Za-z$_]*';
const SUBST = {
className: 'subst',
begin: /#\{/,
end: /\}/,
keywords: KEYWORDS$1
};
const EXPRESSIONS = [
hljs.BINARY_NUMBER_MODE,
hljs.inherit(hljs.C_NUMBER_MODE, {
starts: {
end: '(\\s*/)?',
relevance: 0
}
}), // a number tries to eat the following slash to prevent treating it as a regexp
{
className: 'string',
variants: [
{
begin: /'''/,
end: /'''/,
contains: [hljs.BACKSLASH_ESCAPE]
},
{
begin: /'/,
end: /'/,
contains: [hljs.BACKSLASH_ESCAPE]
},
{
begin: /"""/,
end: /"""/,
contains: [
hljs.BACKSLASH_ESCAPE,
SUBST
]
},
{
begin: /"/,
end: /"/,
contains: [
hljs.BACKSLASH_ESCAPE,
SUBST
]
}
]
},
{
className: 'regexp',
variants: [
{
begin: '///',
end: '///',
contains: [
SUBST,
hljs.HASH_COMMENT_MODE
]
},
{
begin: '//[gim]{0,3}(?=\\W)',
relevance: 0
},
{
// regex can't start with space to parse x / 2 / 3 as two divisions
// regex can't start with *, and it supports an "illegal" in the main mode
begin: /\/(?![ *]).*?(?![\\]).\/[gim]{0,3}(?=\W)/
}
]
},
{
begin: '@' + JS_IDENT_RE // relevance booster
},
{
subLanguage: 'javascript',
excludeBegin: true,
excludeEnd: true,
variants: [
{
begin: '```',
end: '```'
},
{
begin: '`',
end: '`'
}
]
}
];
SUBST.contains = EXPRESSIONS;
const TITLE = hljs.inherit(hljs.TITLE_MODE, {
begin: JS_IDENT_RE
});
const POSSIBLE_PARAMS_RE = '(\\(.*\\)\\s*)?\\B[-=]>';
const PARAMS = {
className: 'params',
begin: '\\([^\\(]',
returnBegin: true,
/* We need another contained nameless mode to not have every nested
pair of parens to be called "params" */
contains: [{
begin: /\(/,
end: /\)/,
keywords: KEYWORDS$1,
contains: ['self'].concat(EXPRESSIONS)
}]
};
return {
name: 'CoffeeScript',
aliases: [
'coffee',
'cson',
'iced'
],
keywords: KEYWORDS$1,
illegal: /\/\*/,
contains: [
...EXPRESSIONS,
hljs.COMMENT('###', '###'),
hljs.HASH_COMMENT_MODE,
{
className: 'function',
begin: '^\\s*' + JS_IDENT_RE + '\\s*=\\s*' + POSSIBLE_PARAMS_RE,
end: '[-=]>',
returnBegin: true,
contains: [
TITLE,
PARAMS
]
},
{
// anonymous function start
begin: /[:\(,=]\s*/,
relevance: 0,
contains: [{
className: 'function',
begin: POSSIBLE_PARAMS_RE,
end: '[-=]>',
returnBegin: true,
contains: [PARAMS]
}]
},
{
className: 'class',
beginKeywords: 'class',
end: '$',
illegal: /[:="\[\]]/,
contains: [
{
beginKeywords: 'extends',
endsWithParent: true,
illegal: /[:="\[\]]/,
contains: [TITLE]
},
TITLE
]
},
{
begin: JS_IDENT_RE + ':',
end: ':',
returnBegin: true,
returnEnd: true,
relevance: 0
}
]
};
}
module.exports = coffeescript;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/coq.js":
/*!********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/coq.js ***!
\********************************************************/
/***/ ((module) => {
/*
Language: Coq
Author: Stephan Boyer
Category: functional
Website: https://coq.inria.fr
*/
/** @type LanguageFn */
function coq(hljs) {
const KEYWORDS = [
"_|0",
"as",
"at",
"cofix",
"else",
"end",
"exists",
"exists2",
"fix",
"for",
"forall",
"fun",
"if",
"IF",
"in",
"let",
"match",
"mod",
"Prop",
"return",
"Set",
"then",
"Type",
"using",
"where",
"with",
"Abort",
"About",
"Add",
"Admit",
"Admitted",
"All",
"Arguments",
"Assumptions",
"Axiom",
"Back",
"BackTo",
"Backtrack",
"Bind",
"Blacklist",
"Canonical",
"Cd",
"Check",
"Class",
"Classes",
"Close",
"Coercion",
"Coercions",
"CoFixpoint",
"CoInductive",
"Collection",
"Combined",
"Compute",
"Conjecture",
"Conjectures",
"Constant",
"constr",
"Constraint",
"Constructors",
"Context",
"Corollary",
"CreateHintDb",
"Cut",
"Declare",
"Defined",
"Definition",
"Delimit",
"Dependencies",
"Dependent",
"Derive",
"Drop",
"eauto",
"End",
"Equality",
"Eval",
"Example",
"Existential",
"Existentials",
"Existing",
"Export",
"exporting",
"Extern",
"Extract",
"Extraction",
"Fact",
"Field",
"Fields",
"File",
"Fixpoint",
"Focus",
"for",
"From",
"Function",
"Functional",
"Generalizable",
"Global",
"Goal",
"Grab",
"Grammar",
"Graph",
"Guarded",
"Heap",
"Hint",
"HintDb",
"Hints",
"Hypotheses",
"Hypothesis",
"ident",
"Identity",
"If",
"Immediate",
"Implicit",
"Import",
"Include",
"Inductive",
"Infix",
"Info",
"Initial",
"Inline",
"Inspect",
"Instance",
"Instances",
"Intro",
"Intros",
"Inversion",
"Inversion_clear",
"Language",
"Left",
"Lemma",
"Let",
"Libraries",
"Library",
"Load",
"LoadPath",
"Local",
"Locate",
"Ltac",
"ML",
"Mode",
"Module",
"Modules",
"Monomorphic",
"Morphism",
"Next",
"NoInline",
"Notation",
"Obligation",
"Obligations",
"Opaque",
"Open",
"Optimize",
"Options",
"Parameter",
"Parameters",
"Parametric",
"Path",
"Paths",
"pattern",
"Polymorphic",
"Preterm",
"Print",
"Printing",
"Program",
"Projections",
"Proof",
"Proposition",
"Pwd",
"Qed",
"Quit",
"Rec",
"Record",
"Recursive",
"Redirect",
"Relation",
"Remark",
"Remove",
"Require",
"Reserved",
"Reset",
"Resolve",
"Restart",
"Rewrite",
"Right",
"Ring",
"Rings",
"Save",
"Scheme",
"Scope",
"Scopes",
"Script",
"Search",
"SearchAbout",
"SearchHead",
"SearchPattern",
"SearchRewrite",
"Section",
"Separate",
"Set",
"Setoid",
"Show",
"Solve",
"Sorted",
"Step",
"Strategies",
"Strategy",
"Structure",
"SubClass",
"Table",
"Tables",
"Tactic",
"Term",
"Test",
"Theorem",
"Time",
"Timeout",
"Transparent",
"Type",
"Typeclasses",
"Types",
"Undelimit",
"Undo",
"Unfocus",
"Unfocused",
"Unfold",
"Universe",
"Universes",
"Unset",
"Unshelve",
"using",
"Variable",
"Variables",
"Variant",
"Verbose",
"Visibility",
"where",
"with"
];
const BUILT_INS = [
"abstract",
"absurd",
"admit",
"after",
"apply",
"as",
"assert",
"assumption",
"at",
"auto",
"autorewrite",
"autounfold",
"before",
"bottom",
"btauto",
"by",
"case",
"case_eq",
"cbn",
"cbv",
"change",
"classical_left",
"classical_right",
"clear",
"clearbody",
"cofix",
"compare",
"compute",
"congruence",
"constr_eq",
"constructor",
"contradict",
"contradiction",
"cut",
"cutrewrite",
"cycle",
"decide",
"decompose",
"dependent",
"destruct",
"destruction",
"dintuition",
"discriminate",
"discrR",
"do",
"double",
"dtauto",
"eapply",
"eassumption",
"eauto",
"ecase",
"econstructor",
"edestruct",
"ediscriminate",
"eelim",
"eexact",
"eexists",
"einduction",
"einjection",
"eleft",
"elim",
"elimtype",
"enough",
"equality",
"erewrite",
"eright",
"esimplify_eq",
"esplit",
"evar",
"exact",
"exactly_once",
"exfalso",
"exists",
"f_equal",
"fail",
"field",
"field_simplify",
"field_simplify_eq",
"first",
"firstorder",
"fix",
"fold",
"fourier",
"functional",
"generalize",
"generalizing",
"gfail",
"give_up",
"has_evar",
"hnf",
"idtac",
"in",
"induction",
"injection",
"instantiate",
"intro",
"intro_pattern",
"intros",
"intuition",
"inversion",
"inversion_clear",
"is_evar",
"is_var",
"lapply",
"lazy",
"left",
"lia",
"lra",
"move",
"native_compute",
"nia",
"nsatz",
"omega",
"once",
"pattern",
"pose",
"progress",
"proof",
"psatz",
"quote",
"record",
"red",
"refine",
"reflexivity",
"remember",
"rename",
"repeat",
"replace",
"revert",
"revgoals",
"rewrite",
"rewrite_strat",
"right",
"ring",
"ring_simplify",
"rtauto",
"set",
"setoid_reflexivity",
"setoid_replace",
"setoid_rewrite",
"setoid_symmetry",
"setoid_transitivity",
"shelve",
"shelve_unifiable",
"simpl",
"simple",
"simplify_eq",
"solve",
"specialize",
"split",
"split_Rabs",
"split_Rmult",
"stepl",
"stepr",
"subst",
"sum",
"swap",
"symmetry",
"tactic",
"tauto",
"time",
"timeout",
"top",
"transitivity",
"trivial",
"try",
"tryif",
"unfold",
"unify",
"until",
"using",
"vm_compute",
"with"
];
return {
name: 'Coq',
keywords: {
keyword: KEYWORDS,
built_in: BUILT_INS
},
contains: [
hljs.QUOTE_STRING_MODE,
hljs.COMMENT('\\(\\*', '\\*\\)'),
hljs.C_NUMBER_MODE,
{
className: 'type',
excludeBegin: true,
begin: '\\|\\s*',
end: '\\w+'
},
{ // relevance booster
begin: /[-=]>/
}
]
};
}
module.exports = coq;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/cos.js":
/*!********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/cos.js ***!
\********************************************************/
/***/ ((module) => {
/*
Language: Caché Object Script
Author: Nikita Savchenko
Category: enterprise, scripting
Website: https://cedocs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls
*/
/** @type LanguageFn */
function cos(hljs) {
const STRINGS = {
className: 'string',
variants: [{
begin: '"',
end: '"',
contains: [{ // escaped
begin: "\"\"",
relevance: 0
}]
}]
};
const NUMBERS = {
className: "number",
begin: "\\b(\\d+(\\.\\d*)?|\\.\\d+)",
relevance: 0
};
const COS_KEYWORDS =
'property parameter class classmethod clientmethod extends as break ' +
'catch close continue do d|0 else elseif for goto halt hang h|0 if job ' +
'j|0 kill k|0 lock l|0 merge new open quit q|0 read r|0 return set s|0 ' +
'tcommit throw trollback try tstart use view while write w|0 xecute x|0 ' +
'zkill znspace zn ztrap zwrite zw zzdump zzwrite print zbreak zinsert ' +
'zload zprint zremove zsave zzprint mv mvcall mvcrt mvdim mvprint zquit ' +
'zsync ascii';
// registered function - no need in them due to all functions are highlighted,
// but I'll just leave this here.
// "$bit", "$bitcount",
// "$bitfind", "$bitlogic", "$case", "$char", "$classmethod", "$classname",
// "$compile", "$data", "$decimal", "$double", "$extract", "$factor",
// "$find", "$fnumber", "$get", "$increment", "$inumber", "$isobject",
// "$isvaliddouble", "$isvalidnum", "$justify", "$length", "$list",
// "$listbuild", "$listdata", "$listfind", "$listfromstring", "$listget",
// "$listlength", "$listnext", "$listsame", "$listtostring", "$listvalid",
// "$locate", "$match", "$method", "$name", "$nconvert", "$next",
// "$normalize", "$now", "$number", "$order", "$parameter", "$piece",
// "$prefetchoff", "$prefetchon", "$property", "$qlength", "$qsubscript",
// "$query", "$random", "$replace", "$reverse", "$sconvert", "$select",
// "$sortbegin", "$sortend", "$stack", "$text", "$translate", "$view",
// "$wascii", "$wchar", "$wextract", "$wfind", "$wiswide", "$wlength",
// "$wreverse", "$xecute", "$zabs", "$zarccos", "$zarcsin", "$zarctan",
// "$zcos", "$zcot", "$zcsc", "$zdate", "$zdateh", "$zdatetime",
// "$zdatetimeh", "$zexp", "$zhex", "$zln", "$zlog", "$zpower", "$zsec",
// "$zsin", "$zsqr", "$ztan", "$ztime", "$ztimeh", "$zboolean",
// "$zconvert", "$zcrc", "$zcyc", "$zdascii", "$zdchar", "$zf",
// "$ziswide", "$zlascii", "$zlchar", "$zname", "$zposition", "$zqascii",
// "$zqchar", "$zsearch", "$zseek", "$zstrip", "$zwascii", "$zwchar",
// "$zwidth", "$zwpack", "$zwbpack", "$zwunpack", "$zwbunpack", "$zzenkaku",
// "$change", "$mv", "$mvat", "$mvfmt", "$mvfmts", "$mviconv",
// "$mviconvs", "$mvinmat", "$mvlover", "$mvoconv", "$mvoconvs", "$mvraise",
// "$mvtrans", "$mvv", "$mvname", "$zbitand", "$zbitcount", "$zbitfind",
// "$zbitget", "$zbitlen", "$zbitnot", "$zbitor", "$zbitset", "$zbitstr",
// "$zbitxor", "$zincrement", "$znext", "$zorder", "$zprevious", "$zsort",
// "device", "$ecode", "$estack", "$etrap", "$halt", "$horolog",
// "$io", "$job", "$key", "$namespace", "$principal", "$quit", "$roles",
// "$storage", "$system", "$test", "$this", "$tlevel", "$username",
// "$x", "$y", "$za", "$zb", "$zchild", "$zeof", "$zeos", "$zerror",
// "$zhorolog", "$zio", "$zjob", "$zmode", "$znspace", "$zparent", "$zpi",
// "$zpos", "$zreference", "$zstorage", "$ztimestamp", "$ztimezone",
// "$ztrap", "$zversion"
return {
name: 'Caché Object Script',
case_insensitive: true,
aliases: [
"cls"
],
keywords: COS_KEYWORDS,
contains: [
NUMBERS,
STRINGS,
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
{
className: "comment",
begin: /;/,
end: "$",
relevance: 0
},
{ // Functions and user-defined functions: write $ztime(60*60*3), $$myFunc(10), $$^Val(1)
className: "built_in",
begin: /(?:\$\$?|\.\.)\^?[a-zA-Z]+/
},
{ // Macro command: quit $$$OK
className: "built_in",
begin: /\$\$\$[a-zA-Z]+/
},
{ // Special (global) variables: write %request.Content; Built-in classes: %Library.Integer
className: "built_in",
begin: /%[a-z]+(?:\.[a-z]+)*/
},
{ // Global variable: set ^globalName = 12 write ^globalName
className: "symbol",
begin: /\^%?[a-zA-Z][\w]*/
},
{ // Some control constructions: do ##class(Package.ClassName).Method(), ##super()
className: "keyword",
begin: /##class|##super|#define|#dim/
},
// sub-languages: are not fully supported by hljs by 11/15/2015
// left for the future implementation.
{
begin: /&sql\(/,
end: /\)/,
excludeBegin: true,
excludeEnd: true,
subLanguage: "sql"
},
{
begin: /&(js|jscript|javascript),
end: />/,
excludeBegin: true,
excludeEnd: true,
subLanguage: "javascript"
},
{
// this brakes first and last tag, but this is the only way to embed a valid html
begin: /&html<\s*,
end: />\s*>/,
subLanguage: "xml"
}
]
};
}
module.exports = cos;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/cpp.js":
/*!********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/cpp.js ***!
\********************************************************/
/***/ ((module) => {
/*
Language: C++
Category: common, system
Website: https://isocpp.org
*/
/** @type LanguageFn */
function cpp(hljs) {
const regex = hljs.regex;
// added for historic reasons because `hljs.C_LINE_COMMENT_MODE` does
// not include such support nor can we be sure all the grammars depending
// on it would desire this behavior
const C_LINE_COMMENT_MODE = hljs.COMMENT('//', '$', {
contains: [
{
begin: /\\\n/
}
]
});
const DECLTYPE_AUTO_RE = 'decltype\\(auto\\)';
const NAMESPACE_RE = '[a-zA-Z_]\\w*::';
const TEMPLATE_ARGUMENT_RE = '<[^<>]+>';
const FUNCTION_TYPE_RE = '(?!struct)(' +
DECLTYPE_AUTO_RE + '|' +
regex.optional(NAMESPACE_RE) +
'[a-zA-Z_]\\w*' + regex.optional(TEMPLATE_ARGUMENT_RE) +
')';
const CPP_PRIMITIVE_TYPES = {
className: 'type',
begin: '\\b[a-z\\d_]*_t\\b'
};
// https://en.cppreference.com/w/cpp/language/escape
// \\ \x \xFF \u2837 \u00323747 \374
const CHARACTER_ESCAPES = '\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)';
const STRINGS = {
className: 'string',
variants: [
{
begin: '(u8?|U|L)?"',
end: '"',
illegal: '\\n',
contains: [ hljs.BACKSLASH_ESCAPE ]
},
{
begin: '(u8?|U|L)?\'(' + CHARACTER_ESCAPES + '|.)',
end: '\'',
illegal: '.'
},
hljs.END_SAME_AS_BEGIN({
begin: /(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,
end: /\)([^()\\ ]{0,16})"/
})
]
};
const NUMBERS = {
className: 'number',
variants: [
{
begin: '\\b(0b[01\']+)'
},
{
begin: '(-?)\\b([\\d\']+(\\.[\\d\']*)?|\\.[\\d\']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)'
},
{
begin: '(-?)(\\b0[xX][a-fA-F0-9\']+|(\\b[\\d\']+(\\.[\\d\']*)?|\\.[\\d\']+)([eE][-+]?[\\d\']+)?)'
}
],
relevance: 0
};
const PREPROCESSOR = {
className: 'meta',
begin: /#\s*[a-z]+\b/,
end: /$/,
keywords: {
keyword:
'if else elif endif define undef warning error line ' +
'pragma _Pragma ifdef ifndef include'
},
contains: [
{
begin: /\\\n/,
relevance: 0
},
hljs.inherit(STRINGS, {
className: 'string'
}),
{
className: 'string',
begin: /<.*?>/
},
C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE
]
};
const TITLE_MODE = {
className: 'title',
begin: regex.optional(NAMESPACE_RE) + hljs.IDENT_RE,
relevance: 0
};
const FUNCTION_TITLE = regex.optional(NAMESPACE_RE) + hljs.IDENT_RE + '\\s*\\(';
// https://en.cppreference.com/w/cpp/keyword
const RESERVED_KEYWORDS = [
'alignas',
'alignof',
'and',
'and_eq',
'asm',
'atomic_cancel',
'atomic_commit',
'atomic_noexcept',
'auto',
'bitand',
'bitor',
'break',
'case',
'catch',
'class',
'co_await',
'co_return',
'co_yield',
'compl',
'concept',
'const_cast|10',
'consteval',
'constexpr',
'constinit',
'continue',
'decltype',
'default',
'delete',
'do',
'dynamic_cast|10',
'else',
'enum',
'explicit',
'export',
'extern',
'false',
'final',
'for',
'friend',
'goto',
'if',
'import',
'inline',
'module',
'mutable',
'namespace',
'new',
'noexcept',
'not',
'not_eq',
'nullptr',
'operator',
'or',
'or_eq',
'override',
'private',
'protected',
'public',
'reflexpr',
'register',
'reinterpret_cast|10',
'requires',
'return',
'sizeof',
'static_assert',
'static_cast|10',
'struct',
'switch',
'synchronized',
'template',
'this',
'thread_local',
'throw',
'transaction_safe',
'transaction_safe_dynamic',
'true',
'try',
'typedef',
'typeid',
'typename',
'union',
'using',
'virtual',
'volatile',
'while',
'xor',
'xor_eq'
];
// https://en.cppreference.com/w/cpp/keyword
const RESERVED_TYPES = [
'bool',
'char',
'char16_t',
'char32_t',
'char8_t',
'double',
'float',
'int',
'long',
'short',
'void',
'wchar_t',
'unsigned',
'signed',
'const',
'static'
];
const TYPE_HINTS = [
'any',
'auto_ptr',
'barrier',
'binary_semaphore',
'bitset',
'complex',
'condition_variable',
'condition_variable_any',
'counting_semaphore',
'deque',
'false_type',
'future',
'imaginary',
'initializer_list',
'istringstream',
'jthread',
'latch',
'lock_guard',
'multimap',
'multiset',
'mutex',
'optional',
'ostringstream',
'packaged_task',
'pair',
'promise',
'priority_queue',
'queue',
'recursive_mutex',
'recursive_timed_mutex',
'scoped_lock',
'set',
'shared_future',
'shared_lock',
'shared_mutex',
'shared_timed_mutex',
'shared_ptr',
'stack',
'string_view',
'stringstream',
'timed_mutex',
'thread',
'true_type',
'tuple',
'unique_lock',
'unique_ptr',
'unordered_map',
'unordered_multimap',
'unordered_multiset',
'unordered_set',
'variant',
'vector',
'weak_ptr',
'wstring',
'wstring_view'
];
const FUNCTION_HINTS = [
'abort',
'abs',
'acos',
'apply',
'as_const',
'asin',
'atan',
'atan2',
'calloc',
'ceil',
'cerr',
'cin',
'clog',
'cos',
'cosh',
'cout',
'declval',
'endl',
'exchange',
'exit',
'exp',
'fabs',
'floor',
'fmod',
'forward',
'fprintf',
'fputs',
'free',
'frexp',
'fscanf',
'future',
'invoke',
'isalnum',
'isalpha',
'iscntrl',
'isdigit',
'isgraph',
'islower',
'isprint',
'ispunct',
'isspace',
'isupper',
'isxdigit',
'labs',
'launder',
'ldexp',
'log',
'log10',
'make_pair',
'make_shared',
'make_shared_for_overwrite',
'make_tuple',
'make_unique',
'malloc',
'memchr',
'memcmp',
'memcpy',
'memset',
'modf',
'move',
'pow',
'printf',
'putchar',
'puts',
'realloc',
'scanf',
'sin',
'sinh',
'snprintf',
'sprintf',
'sqrt',
'sscanf',
'std',
'stderr',
'stdin',
'stdout',
'strcat',
'strchr',
'strcmp',
'strcpy',
'strcspn',
'strlen',
'strncat',
'strncmp',
'strncpy',
'strpbrk',
'strrchr',
'strspn',
'strstr',
'swap',
'tan',
'tanh',
'terminate',
'to_underlying',
'tolower',
'toupper',
'vfprintf',
'visit',
'vprintf',
'vsprintf'
];
const LITERALS = [
'NULL',
'false',
'nullopt',
'nullptr',
'true'
];
// https://en.cppreference.com/w/cpp/keyword
const BUILT_IN = [
'_Pragma'
];
const CPP_KEYWORDS = {
type: RESERVED_TYPES,
keyword: RESERVED_KEYWORDS,
literal: LITERALS,
built_in: BUILT_IN,
_type_hints: TYPE_HINTS
};
const FUNCTION_DISPATCH = {
className: 'function.dispatch',
relevance: 0,
keywords: {
// Only for relevance, not highlighting.
_hint: FUNCTION_HINTS
},
begin: regex.concat(
/\b/,
/(?!decltype)/,
/(?!if)/,
/(?!for)/,
/(?!switch)/,
/(?!while)/,
hljs.IDENT_RE,
regex.lookahead(/(<[^<>]+>|)\s*\(/))
};
const EXPRESSION_CONTAINS = [
FUNCTION_DISPATCH,
PREPROCESSOR,
CPP_PRIMITIVE_TYPES,
C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
NUMBERS,
STRINGS
];
const EXPRESSION_CONTEXT = {
// This mode covers expression context where we can't expect a function
// definition and shouldn't highlight anything that looks like one:
// `return some()`, `else if()`, `(x*sum(1, 2))`
variants: [
{
begin: /=/,
end: /;/
},
{
begin: /\(/,
end: /\)/
},
{
beginKeywords: 'new throw return else',
end: /;/
}
],
keywords: CPP_KEYWORDS,
contains: EXPRESSION_CONTAINS.concat([
{
begin: /\(/,
end: /\)/,
keywords: CPP_KEYWORDS,
contains: EXPRESSION_CONTAINS.concat([ 'self' ]),
relevance: 0
}
]),
relevance: 0
};
const FUNCTION_DECLARATION = {
className: 'function',
begin: '(' + FUNCTION_TYPE_RE + '[\\*&\\s]+)+' + FUNCTION_TITLE,
returnBegin: true,
end: /[{;=]/,
excludeEnd: true,
keywords: CPP_KEYWORDS,
illegal: /[^\w\s\*&:<>.]/,
contains: [
{ // to prevent it from being confused as the function title
begin: DECLTYPE_AUTO_RE,
keywords: CPP_KEYWORDS,
relevance: 0
},
{
begin: FUNCTION_TITLE,
returnBegin: true,
contains: [ TITLE_MODE ],
relevance: 0
},
// needed because we do not have look-behind on the below rule
// to prevent it from grabbing the final : in a :: pair
{
begin: /::/,
relevance: 0
},
// initializers
{
begin: /:/,
endsWithParent: true,
contains: [
STRINGS,
NUMBERS
]
},
// allow for multiple declarations, e.g.:
// extern void f(int), g(char);
{
relevance: 0,
match: /,/
},
{
className: 'params',
begin: /\(/,
end: /\)/,
keywords: CPP_KEYWORDS,
relevance: 0,
contains: [
C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
STRINGS,
NUMBERS,
CPP_PRIMITIVE_TYPES,
// Count matching parentheses.
{
begin: /\(/,
end: /\)/,
keywords: CPP_KEYWORDS,
relevance: 0,
contains: [
'self',
C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
STRINGS,
NUMBERS,
CPP_PRIMITIVE_TYPES
]
}
]
},
CPP_PRIMITIVE_TYPES,
C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
PREPROCESSOR
]
};
return {
name: 'C++',
aliases: [
'cc',
'c++',
'h++',
'hpp',
'hh',
'hxx',
'cxx'
],
keywords: CPP_KEYWORDS,
illegal: '',
classNameAliases: {
'function.dispatch': 'built_in'
},
contains: [].concat(
EXPRESSION_CONTEXT,
FUNCTION_DECLARATION,
FUNCTION_DISPATCH,
EXPRESSION_CONTAINS,
[
PREPROCESSOR,
{ // containers: ie, `vector rooms (9);`
begin: '\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<',
end: '>',
keywords: CPP_KEYWORDS,
contains: [
'self',
CPP_PRIMITIVE_TYPES
]
},
{
begin: hljs.IDENT_RE + '::',
keywords: CPP_KEYWORDS
},
{
match: [
// extra complexity to deal with `enum class` and `enum struct`
/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,
/\s+/,
/\w+/
],
className: {
1: 'keyword',
3: 'title.class'
}
}
])
};
}
module.exports = cpp;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/crmsh.js":
/*!**********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/crmsh.js ***!
\**********************************************************/
/***/ ((module) => {
/*
Language: crmsh
Author: Kristoffer Gronlund
Website: http://crmsh.github.io
Description: Syntax Highlighting for the crmsh DSL
Category: config
*/
/** @type LanguageFn */
function crmsh(hljs) {
const RESOURCES = 'primitive rsc_template';
const COMMANDS = 'group clone ms master location colocation order fencing_topology ' +
'rsc_ticket acl_target acl_group user role ' +
'tag xml';
const PROPERTY_SETS = 'property rsc_defaults op_defaults';
const KEYWORDS = 'params meta operations op rule attributes utilization';
const OPERATORS = 'read write deny defined not_defined in_range date spec in ' +
'ref reference attribute type xpath version and or lt gt tag ' +
'lte gte eq ne \\';
const TYPES = 'number string';
const LITERALS = 'Master Started Slave Stopped start promote demote stop monitor true false';
return {
name: 'crmsh',
aliases: [
'crm',
'pcmk'
],
case_insensitive: true,
keywords: {
keyword: KEYWORDS + ' ' + OPERATORS + ' ' + TYPES,
literal: LITERALS
},
contains: [
hljs.HASH_COMMENT_MODE,
{
beginKeywords: 'node',
starts: {
end: '\\s*([\\w_-]+:)?',
starts: {
className: 'title',
end: '\\s*[\\$\\w_][\\w_-]*'
}
}
},
{
beginKeywords: RESOURCES,
starts: {
className: 'title',
end: '\\s*[\\$\\w_][\\w_-]*',
starts: {
end: '\\s*@?[\\w_][\\w_\\.:-]*'
}
}
},
{
begin: '\\b(' + COMMANDS.split(' ').join('|') + ')\\s+',
keywords: COMMANDS,
starts: {
className: 'title',
end: '[\\$\\w_][\\w_-]*'
}
},
{
beginKeywords: PROPERTY_SETS,
starts: {
className: 'title',
end: '\\s*([\\w_-]+:)?'
}
},
hljs.QUOTE_STRING_MODE,
{
className: 'meta',
begin: '(ocf|systemd|service|lsb):[\\w_:-]+',
relevance: 0
},
{
className: 'number',
begin: '\\b\\d+(\\.\\d+)?(ms|s|h|m)?',
relevance: 0
},
{
className: 'literal',
begin: '[-]?(infinity|inf)',
relevance: 0
},
{
className: 'attr',
begin: /([A-Za-z$_#][\w_-]+)=/,
relevance: 0
},
{
className: 'tag',
begin: '?',
end: '/?>',
relevance: 0
}
]
};
}
module.exports = crmsh;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/crystal.js":
/*!************************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/crystal.js ***!
\************************************************************/
/***/ ((module) => {
/*
Language: Crystal
Author: TSUYUSATO Kitsune
Website: https://crystal-lang.org
*/
/** @type LanguageFn */
function crystal(hljs) {
const INT_SUFFIX = '(_?[ui](8|16|32|64|128))?';
const FLOAT_SUFFIX = '(_?f(32|64))?';
const CRYSTAL_IDENT_RE = '[a-zA-Z_]\\w*[!?=]?';
const CRYSTAL_METHOD_RE = '[a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|[=!]~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~|]|//|//=|&[-+*]=?|&\\*\\*|\\[\\][=?]?';
const CRYSTAL_PATH_RE = '[A-Za-z_]\\w*(::\\w+)*(\\?|!)?';
const CRYSTAL_KEYWORDS = {
$pattern: CRYSTAL_IDENT_RE,
keyword:
'abstract alias annotation as as? asm begin break case class def do else elsif end ensure enum extend for fun if ' +
'include instance_sizeof is_a? lib macro module next nil? of out pointerof private protected rescue responds_to? ' +
'return require select self sizeof struct super then type typeof union uninitialized unless until verbatim when while with yield ' +
'__DIR__ __END_LINE__ __FILE__ __LINE__',
literal: 'false nil true'
};
const SUBST = {
className: 'subst',
begin: /#\{/,
end: /\}/,
keywords: CRYSTAL_KEYWORDS
};
// borrowed from Ruby
const VARIABLE = {
// negative-look forward attemps to prevent false matches like:
// @ident@ or $ident$ that might indicate this is not ruby at all
className: "variable",
begin: '(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])' + `(?![A-Za-z])(?![@$?'])`
};
const EXPANSION = {
className: 'template-variable',
variants: [
{
begin: '\\{\\{',
end: '\\}\\}'
},
{
begin: '\\{%',
end: '%\\}'
}
],
keywords: CRYSTAL_KEYWORDS
};
function recursiveParen(begin, end) {
const
contains = [
{
begin: begin,
end: end
}
];
contains[0].contains = contains;
return contains;
}
const STRING = {
className: 'string',
contains: [
hljs.BACKSLASH_ESCAPE,
SUBST
],
variants: [
{
begin: /'/,
end: /'/
},
{
begin: /"/,
end: /"/
},
{
begin: /`/,
end: /`/
},
{
begin: '%[Qwi]?\\(',
end: '\\)',
contains: recursiveParen('\\(', '\\)')
},
{
begin: '%[Qwi]?\\[',
end: '\\]',
contains: recursiveParen('\\[', '\\]')
},
{
begin: '%[Qwi]?\\{',
end: /\}/,
contains: recursiveParen(/\{/, /\}/)
},
{
begin: '%[Qwi]?<',
end: '>',
contains: recursiveParen('<', '>')
},
{
begin: '%[Qwi]?\\|',
end: '\\|'
},
{
begin: /<<-\w+$/,
end: /^\s*\w+$/
}
],
relevance: 0
};
const Q_STRING = {
className: 'string',
variants: [
{
begin: '%q\\(',
end: '\\)',
contains: recursiveParen('\\(', '\\)')
},
{
begin: '%q\\[',
end: '\\]',
contains: recursiveParen('\\[', '\\]')
},
{
begin: '%q\\{',
end: /\}/,
contains: recursiveParen(/\{/, /\}/)
},
{
begin: '%q<',
end: '>',
contains: recursiveParen('<', '>')
},
{
begin: '%q\\|',
end: '\\|'
},
{
begin: /<<-'\w+'$/,
end: /^\s*\w+$/
}
],
relevance: 0
};
const REGEXP = {
begin: '(?!%\\})(' + hljs.RE_STARTERS_RE + '|\\n|\\b(case|if|select|unless|until|when|while)\\b)\\s*',
keywords: 'case if select unless until when while',
contains: [
{
className: 'regexp',
contains: [
hljs.BACKSLASH_ESCAPE,
SUBST
],
variants: [
{
begin: '//[a-z]*',
relevance: 0
},
{
begin: '/(?!\\/)',
end: '/[a-z]*'
}
]
}
],
relevance: 0
};
const REGEXP2 = {
className: 'regexp',
contains: [
hljs.BACKSLASH_ESCAPE,
SUBST
],
variants: [
{
begin: '%r\\(',
end: '\\)',
contains: recursiveParen('\\(', '\\)')
},
{
begin: '%r\\[',
end: '\\]',
contains: recursiveParen('\\[', '\\]')
},
{
begin: '%r\\{',
end: /\}/,
contains: recursiveParen(/\{/, /\}/)
},
{
begin: '%r<',
end: '>',
contains: recursiveParen('<', '>')
},
{
begin: '%r\\|',
end: '\\|'
}
],
relevance: 0
};
const ATTRIBUTE = {
className: 'meta',
begin: '@\\[',
end: '\\]',
contains: [
hljs.inherit(hljs.QUOTE_STRING_MODE, {
className: 'string'
})
]
};
const CRYSTAL_DEFAULT_CONTAINS = [
EXPANSION,
STRING,
Q_STRING,
REGEXP2,
REGEXP,
ATTRIBUTE,
VARIABLE,
hljs.HASH_COMMENT_MODE,
{
className: 'class',
beginKeywords: 'class module struct',
end: '$|;',
illegal: /=/,
contains: [
hljs.HASH_COMMENT_MODE,
hljs.inherit(hljs.TITLE_MODE, {
begin: CRYSTAL_PATH_RE
}),
{ // relevance booster for inheritance
begin: '<'
}
]
},
{
className: 'class',
beginKeywords: 'lib enum union',
end: '$|;',
illegal: /=/,
contains: [
hljs.HASH_COMMENT_MODE,
hljs.inherit(hljs.TITLE_MODE, {
begin: CRYSTAL_PATH_RE
})
]
},
{
beginKeywords: 'annotation',
end: '$|;',
illegal: /=/,
contains: [
hljs.HASH_COMMENT_MODE,
hljs.inherit(hljs.TITLE_MODE, {
begin: CRYSTAL_PATH_RE
})
],
relevance: 2
},
{
className: 'function',
beginKeywords: 'def',
end: /\B\b/,
contains: [
hljs.inherit(hljs.TITLE_MODE, {
begin: CRYSTAL_METHOD_RE,
endsParent: true
})
]
},
{
className: 'function',
beginKeywords: 'fun macro',
end: /\B\b/,
contains: [
hljs.inherit(hljs.TITLE_MODE, {
begin: CRYSTAL_METHOD_RE,
endsParent: true
})
],
relevance: 2
},
{
className: 'symbol',
begin: hljs.UNDERSCORE_IDENT_RE + '(!|\\?)?:',
relevance: 0
},
{
className: 'symbol',
begin: ':',
contains: [
STRING,
{
begin: CRYSTAL_METHOD_RE
}
],
relevance: 0
},
{
className: 'number',
variants: [
{
begin: '\\b0b([01_]+)' + INT_SUFFIX
},
{
begin: '\\b0o([0-7_]+)' + INT_SUFFIX
},
{
begin: '\\b0x([A-Fa-f0-9_]+)' + INT_SUFFIX
},
{
begin: '\\b([1-9][0-9_]*[0-9]|[0-9])(\\.[0-9][0-9_]*)?([eE]_?[-+]?[0-9_]*)?' + FLOAT_SUFFIX + '(?!_)'
},
{
begin: '\\b([1-9][0-9_]*|0)' + INT_SUFFIX
}
],
relevance: 0
}
];
SUBST.contains = CRYSTAL_DEFAULT_CONTAINS;
EXPANSION.contains = CRYSTAL_DEFAULT_CONTAINS.slice(1); // without EXPANSION
return {
name: 'Crystal',
aliases: [ 'cr' ],
keywords: CRYSTAL_KEYWORDS,
contains: CRYSTAL_DEFAULT_CONTAINS
};
}
module.exports = crystal;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/csharp.js":
/*!***********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/csharp.js ***!
\***********************************************************/
/***/ ((module) => {
/*
Language: C#
Author: Jason Diamond
Contributor: Nicolas LLOBERA , Pieter Vantorre , David Pine
Website: https://docs.microsoft.com/en-us/dotnet/csharp/
Category: common
*/
/** @type LanguageFn */
function csharp(hljs) {
const BUILT_IN_KEYWORDS = [
'bool',
'byte',
'char',
'decimal',
'delegate',
'double',
'dynamic',
'enum',
'float',
'int',
'long',
'nint',
'nuint',
'object',
'sbyte',
'short',
'string',
'ulong',
'uint',
'ushort'
];
const FUNCTION_MODIFIERS = [
'public',
'private',
'protected',
'static',
'internal',
'protected',
'abstract',
'async',
'extern',
'override',
'unsafe',
'virtual',
'new',
'sealed',
'partial'
];
const LITERAL_KEYWORDS = [
'default',
'false',
'null',
'true'
];
const NORMAL_KEYWORDS = [
'abstract',
'as',
'base',
'break',
'case',
'catch',
'class',
'const',
'continue',
'do',
'else',
'event',
'explicit',
'extern',
'finally',
'fixed',
'for',
'foreach',
'goto',
'if',
'implicit',
'in',
'interface',
'internal',
'is',
'lock',
'namespace',
'new',
'operator',
'out',
'override',
'params',
'private',
'protected',
'public',
'readonly',
'record',
'ref',
'return',
'sealed',
'sizeof',
'stackalloc',
'static',
'struct',
'switch',
'this',
'throw',
'try',
'typeof',
'unchecked',
'unsafe',
'using',
'virtual',
'void',
'volatile',
'while'
];
const CONTEXTUAL_KEYWORDS = [
'add',
'alias',
'and',
'ascending',
'async',
'await',
'by',
'descending',
'equals',
'from',
'get',
'global',
'group',
'init',
'into',
'join',
'let',
'nameof',
'not',
'notnull',
'on',
'or',
'orderby',
'partial',
'remove',
'select',
'set',
'unmanaged',
'value|0',
'var',
'when',
'where',
'with',
'yield'
];
const KEYWORDS = {
keyword: NORMAL_KEYWORDS.concat(CONTEXTUAL_KEYWORDS),
built_in: BUILT_IN_KEYWORDS,
literal: LITERAL_KEYWORDS
};
const TITLE_MODE = hljs.inherit(hljs.TITLE_MODE, {
begin: '[a-zA-Z](\\.?\\w)*'
});
const NUMBERS = {
className: 'number',
variants: [
{
begin: '\\b(0b[01\']+)'
},
{
begin: '(-?)\\b([\\d\']+(\\.[\\d\']*)?|\\.[\\d\']+)(u|U|l|L|ul|UL|f|F|b|B)'
},
{
begin: '(-?)(\\b0[xX][a-fA-F0-9\']+|(\\b[\\d\']+(\\.[\\d\']*)?|\\.[\\d\']+)([eE][-+]?[\\d\']+)?)'
}
],
relevance: 0
};
const VERBATIM_STRING = {
className: 'string',
begin: '@"',
end: '"',
contains: [
{
begin: '""'
}
]
};
const VERBATIM_STRING_NO_LF = hljs.inherit(VERBATIM_STRING, {
illegal: /\n/
});
const SUBST = {
className: 'subst',
begin: /\{/,
end: /\}/,
keywords: KEYWORDS
};
const SUBST_NO_LF = hljs.inherit(SUBST, {
illegal: /\n/
});
const INTERPOLATED_STRING = {
className: 'string',
begin: /\$"/,
end: '"',
illegal: /\n/,
contains: [
{
begin: /\{\{/
},
{
begin: /\}\}/
},
hljs.BACKSLASH_ESCAPE,
SUBST_NO_LF
]
};
const INTERPOLATED_VERBATIM_STRING = {
className: 'string',
begin: /\$@"/,
end: '"',
contains: [
{
begin: /\{\{/
},
{
begin: /\}\}/
},
{
begin: '""'
},
SUBST
]
};
const INTERPOLATED_VERBATIM_STRING_NO_LF = hljs.inherit(INTERPOLATED_VERBATIM_STRING, {
illegal: /\n/,
contains: [
{
begin: /\{\{/
},
{
begin: /\}\}/
},
{
begin: '""'
},
SUBST_NO_LF
]
});
SUBST.contains = [
INTERPOLATED_VERBATIM_STRING,
INTERPOLATED_STRING,
VERBATIM_STRING,
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE,
NUMBERS,
hljs.C_BLOCK_COMMENT_MODE
];
SUBST_NO_LF.contains = [
INTERPOLATED_VERBATIM_STRING_NO_LF,
INTERPOLATED_STRING,
VERBATIM_STRING_NO_LF,
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE,
NUMBERS,
hljs.inherit(hljs.C_BLOCK_COMMENT_MODE, {
illegal: /\n/
})
];
const STRING = {
variants: [
INTERPOLATED_VERBATIM_STRING,
INTERPOLATED_STRING,
VERBATIM_STRING,
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE
]
};
const GENERIC_MODIFIER = {
begin: "<",
end: ">",
contains: [
{
beginKeywords: "in out"
},
TITLE_MODE
]
};
const TYPE_IDENT_RE = hljs.IDENT_RE + '(<' + hljs.IDENT_RE + '(\\s*,\\s*' + hljs.IDENT_RE + ')*>)?(\\[\\])?';
const AT_IDENTIFIER = {
// prevents expressions like `@class` from incorrect flagging
// `class` as a keyword
begin: "@" + hljs.IDENT_RE,
relevance: 0
};
return {
name: 'C#',
aliases: [
'cs',
'c#'
],
keywords: KEYWORDS,
illegal: /::/,
contains: [
hljs.COMMENT(
'///',
'$',
{
returnBegin: true,
contains: [
{
className: 'doctag',
variants: [
{
begin: '///',
relevance: 0
},
{
begin: ''
},
{
begin: '?',
end: '>'
}
]
}
]
}
),
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
{
className: 'meta',
begin: '#',
end: '$',
keywords: {
keyword: 'if else elif endif define undef warning error line region endregion pragma checksum'
}
},
STRING,
NUMBERS,
{
beginKeywords: 'class interface',
relevance: 0,
end: /[{;=]/,
illegal: /[^\s:,]/,
contains: [
{
beginKeywords: "where class"
},
TITLE_MODE,
GENERIC_MODIFIER,
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE
]
},
{
beginKeywords: 'namespace',
relevance: 0,
end: /[{;=]/,
illegal: /[^\s:]/,
contains: [
TITLE_MODE,
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE
]
},
{
beginKeywords: 'record',
relevance: 0,
end: /[{;=]/,
illegal: /[^\s:]/,
contains: [
TITLE_MODE,
GENERIC_MODIFIER,
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE
]
},
{
// [Attributes("")]
className: 'meta',
begin: '^\\s*\\[(?=[\\w])',
excludeBegin: true,
end: '\\]',
excludeEnd: true,
contains: [
{
className: 'string',
begin: /"/,
end: /"/
}
]
},
{
// Expression keywords prevent 'keyword Name(...)' from being
// recognized as a function definition
beginKeywords: 'new return throw await else',
relevance: 0
},
{
className: 'function',
begin: '(' + TYPE_IDENT_RE + '\\s+)+' + hljs.IDENT_RE + '\\s*(<[^=]+>\\s*)?\\(',
returnBegin: true,
end: /\s*[{;=]/,
excludeEnd: true,
keywords: KEYWORDS,
contains: [
// prevents these from being highlighted `title`
{
beginKeywords: FUNCTION_MODIFIERS.join(" "),
relevance: 0
},
{
begin: hljs.IDENT_RE + '\\s*(<[^=]+>\\s*)?\\(',
returnBegin: true,
contains: [
hljs.TITLE_MODE,
GENERIC_MODIFIER
],
relevance: 0
},
{
match: /\(\)/
},
{
className: 'params',
begin: /\(/,
end: /\)/,
excludeBegin: true,
excludeEnd: true,
keywords: KEYWORDS,
relevance: 0,
contains: [
STRING,
NUMBERS,
hljs.C_BLOCK_COMMENT_MODE
]
},
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE
]
},
AT_IDENTIFIER
]
};
}
module.exports = csharp;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/csp.js":
/*!********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/csp.js ***!
\********************************************************/
/***/ ((module) => {
/*
Language: CSP
Description: Content Security Policy definition highlighting
Author: Taras
Website: https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
vim: ts=2 sw=2 st=2
*/
/** @type LanguageFn */
function csp(hljs) {
const KEYWORDS = [
"base-uri",
"child-src",
"connect-src",
"default-src",
"font-src",
"form-action",
"frame-ancestors",
"frame-src",
"img-src",
"manifest-src",
"media-src",
"object-src",
"plugin-types",
"report-uri",
"sandbox",
"script-src",
"style-src",
"trusted-types",
"unsafe-hashes",
"worker-src"
];
return {
name: 'CSP',
case_insensitive: false,
keywords: {
$pattern: '[a-zA-Z][a-zA-Z0-9_-]*',
keyword: KEYWORDS
},
contains: [
{
className: 'string',
begin: "'",
end: "'"
},
{
className: 'attribute',
begin: '^Content',
end: ':',
excludeEnd: true
}
]
};
}
module.exports = csp;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/css.js":
/*!********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/css.js ***!
\********************************************************/
/***/ ((module) => {
const MODES = (hljs) => {
return {
IMPORTANT: {
scope: 'meta',
begin: '!important'
},
BLOCK_COMMENT: hljs.C_BLOCK_COMMENT_MODE,
HEXCOLOR: {
scope: 'number',
begin: /#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/
},
FUNCTION_DISPATCH: {
className: "built_in",
begin: /[\w-]+(?=\()/
},
ATTRIBUTE_SELECTOR_MODE: {
scope: 'selector-attr',
begin: /\[/,
end: /\]/,
illegal: '$',
contains: [
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE
]
},
CSS_NUMBER_MODE: {
scope: 'number',
begin: hljs.NUMBER_RE + '(' +
'%|em|ex|ch|rem' +
'|vw|vh|vmin|vmax' +
'|cm|mm|in|pt|pc|px' +
'|deg|grad|rad|turn' +
'|s|ms' +
'|Hz|kHz' +
'|dpi|dpcm|dppx' +
')?',
relevance: 0
},
CSS_VARIABLE: {
className: "attr",
begin: /--[A-Za-z][A-Za-z0-9_-]*/
}
};
};
const TAGS = [
'a',
'abbr',
'address',
'article',
'aside',
'audio',
'b',
'blockquote',
'body',
'button',
'canvas',
'caption',
'cite',
'code',
'dd',
'del',
'details',
'dfn',
'div',
'dl',
'dt',
'em',
'fieldset',
'figcaption',
'figure',
'footer',
'form',
'h1',
'h2',
'h3',
'h4',
'h5',
'h6',
'header',
'hgroup',
'html',
'i',
'iframe',
'img',
'input',
'ins',
'kbd',
'label',
'legend',
'li',
'main',
'mark',
'menu',
'nav',
'object',
'ol',
'p',
'q',
'quote',
'samp',
'section',
'span',
'strong',
'summary',
'sup',
'table',
'tbody',
'td',
'textarea',
'tfoot',
'th',
'thead',
'time',
'tr',
'ul',
'var',
'video'
];
const MEDIA_FEATURES = [
'any-hover',
'any-pointer',
'aspect-ratio',
'color',
'color-gamut',
'color-index',
'device-aspect-ratio',
'device-height',
'device-width',
'display-mode',
'forced-colors',
'grid',
'height',
'hover',
'inverted-colors',
'monochrome',
'orientation',
'overflow-block',
'overflow-inline',
'pointer',
'prefers-color-scheme',
'prefers-contrast',
'prefers-reduced-motion',
'prefers-reduced-transparency',
'resolution',
'scan',
'scripting',
'update',
'width',
// TODO: find a better solution?
'min-width',
'max-width',
'min-height',
'max-height'
];
// https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes
const PSEUDO_CLASSES = [
'active',
'any-link',
'blank',
'checked',
'current',
'default',
'defined',
'dir', // dir()
'disabled',
'drop',
'empty',
'enabled',
'first',
'first-child',
'first-of-type',
'fullscreen',
'future',
'focus',
'focus-visible',
'focus-within',
'has', // has()
'host', // host or host()
'host-context', // host-context()
'hover',
'indeterminate',
'in-range',
'invalid',
'is', // is()
'lang', // lang()
'last-child',
'last-of-type',
'left',
'link',
'local-link',
'not', // not()
'nth-child', // nth-child()
'nth-col', // nth-col()
'nth-last-child', // nth-last-child()
'nth-last-col', // nth-last-col()
'nth-last-of-type', //nth-last-of-type()
'nth-of-type', //nth-of-type()
'only-child',
'only-of-type',
'optional',
'out-of-range',
'past',
'placeholder-shown',
'read-only',
'read-write',
'required',
'right',
'root',
'scope',
'target',
'target-within',
'user-invalid',
'valid',
'visited',
'where' // where()
];
// https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements
const PSEUDO_ELEMENTS = [
'after',
'backdrop',
'before',
'cue',
'cue-region',
'first-letter',
'first-line',
'grammar-error',
'marker',
'part',
'placeholder',
'selection',
'slotted',
'spelling-error'
];
const ATTRIBUTES = [
'align-content',
'align-items',
'align-self',
'all',
'animation',
'animation-delay',
'animation-direction',
'animation-duration',
'animation-fill-mode',
'animation-iteration-count',
'animation-name',
'animation-play-state',
'animation-timing-function',
'backface-visibility',
'background',
'background-attachment',
'background-clip',
'background-color',
'background-image',
'background-origin',
'background-position',
'background-repeat',
'background-size',
'border',
'border-bottom',
'border-bottom-color',
'border-bottom-left-radius',
'border-bottom-right-radius',
'border-bottom-style',
'border-bottom-width',
'border-collapse',
'border-color',
'border-image',
'border-image-outset',
'border-image-repeat',
'border-image-slice',
'border-image-source',
'border-image-width',
'border-left',
'border-left-color',
'border-left-style',
'border-left-width',
'border-radius',
'border-right',
'border-right-color',
'border-right-style',
'border-right-width',
'border-spacing',
'border-style',
'border-top',
'border-top-color',
'border-top-left-radius',
'border-top-right-radius',
'border-top-style',
'border-top-width',
'border-width',
'bottom',
'box-decoration-break',
'box-shadow',
'box-sizing',
'break-after',
'break-before',
'break-inside',
'caption-side',
'caret-color',
'clear',
'clip',
'clip-path',
'clip-rule',
'color',
'column-count',
'column-fill',
'column-gap',
'column-rule',
'column-rule-color',
'column-rule-style',
'column-rule-width',
'column-span',
'column-width',
'columns',
'contain',
'content',
'content-visibility',
'counter-increment',
'counter-reset',
'cue',
'cue-after',
'cue-before',
'cursor',
'direction',
'display',
'empty-cells',
'filter',
'flex',
'flex-basis',
'flex-direction',
'flex-flow',
'flex-grow',
'flex-shrink',
'flex-wrap',
'float',
'flow',
'font',
'font-display',
'font-family',
'font-feature-settings',
'font-kerning',
'font-language-override',
'font-size',
'font-size-adjust',
'font-smoothing',
'font-stretch',
'font-style',
'font-synthesis',
'font-variant',
'font-variant-caps',
'font-variant-east-asian',
'font-variant-ligatures',
'font-variant-numeric',
'font-variant-position',
'font-variation-settings',
'font-weight',
'gap',
'glyph-orientation-vertical',
'grid',
'grid-area',
'grid-auto-columns',
'grid-auto-flow',
'grid-auto-rows',
'grid-column',
'grid-column-end',
'grid-column-start',
'grid-gap',
'grid-row',
'grid-row-end',
'grid-row-start',
'grid-template',
'grid-template-areas',
'grid-template-columns',
'grid-template-rows',
'hanging-punctuation',
'height',
'hyphens',
'icon',
'image-orientation',
'image-rendering',
'image-resolution',
'ime-mode',
'isolation',
'justify-content',
'left',
'letter-spacing',
'line-break',
'line-height',
'list-style',
'list-style-image',
'list-style-position',
'list-style-type',
'margin',
'margin-bottom',
'margin-left',
'margin-right',
'margin-top',
'marks',
'mask',
'mask-border',
'mask-border-mode',
'mask-border-outset',
'mask-border-repeat',
'mask-border-slice',
'mask-border-source',
'mask-border-width',
'mask-clip',
'mask-composite',
'mask-image',
'mask-mode',
'mask-origin',
'mask-position',
'mask-repeat',
'mask-size',
'mask-type',
'max-height',
'max-width',
'min-height',
'min-width',
'mix-blend-mode',
'nav-down',
'nav-index',
'nav-left',
'nav-right',
'nav-up',
'none',
'normal',
'object-fit',
'object-position',
'opacity',
'order',
'orphans',
'outline',
'outline-color',
'outline-offset',
'outline-style',
'outline-width',
'overflow',
'overflow-wrap',
'overflow-x',
'overflow-y',
'padding',
'padding-bottom',
'padding-left',
'padding-right',
'padding-top',
'page-break-after',
'page-break-before',
'page-break-inside',
'pause',
'pause-after',
'pause-before',
'perspective',
'perspective-origin',
'pointer-events',
'position',
'quotes',
'resize',
'rest',
'rest-after',
'rest-before',
'right',
'row-gap',
'scroll-margin',
'scroll-margin-block',
'scroll-margin-block-end',
'scroll-margin-block-start',
'scroll-margin-bottom',
'scroll-margin-inline',
'scroll-margin-inline-end',
'scroll-margin-inline-start',
'scroll-margin-left',
'scroll-margin-right',
'scroll-margin-top',
'scroll-padding',
'scroll-padding-block',
'scroll-padding-block-end',
'scroll-padding-block-start',
'scroll-padding-bottom',
'scroll-padding-inline',
'scroll-padding-inline-end',
'scroll-padding-inline-start',
'scroll-padding-left',
'scroll-padding-right',
'scroll-padding-top',
'scroll-snap-align',
'scroll-snap-stop',
'scroll-snap-type',
'shape-image-threshold',
'shape-margin',
'shape-outside',
'speak',
'speak-as',
'src', // @font-face
'tab-size',
'table-layout',
'text-align',
'text-align-all',
'text-align-last',
'text-combine-upright',
'text-decoration',
'text-decoration-color',
'text-decoration-line',
'text-decoration-style',
'text-emphasis',
'text-emphasis-color',
'text-emphasis-position',
'text-emphasis-style',
'text-indent',
'text-justify',
'text-orientation',
'text-overflow',
'text-rendering',
'text-shadow',
'text-transform',
'text-underline-position',
'top',
'transform',
'transform-box',
'transform-origin',
'transform-style',
'transition',
'transition-delay',
'transition-duration',
'transition-property',
'transition-timing-function',
'unicode-bidi',
'vertical-align',
'visibility',
'voice-balance',
'voice-duration',
'voice-family',
'voice-pitch',
'voice-range',
'voice-rate',
'voice-stress',
'voice-volume',
'white-space',
'widows',
'width',
'will-change',
'word-break',
'word-spacing',
'word-wrap',
'writing-mode',
'z-index'
// reverse makes sure longer attributes `font-weight` are matched fully
// instead of getting false positives on say `font`
].reverse();
/*
Language: CSS
Category: common, css, web
Website: https://developer.mozilla.org/en-US/docs/Web/CSS
*/
/** @type LanguageFn */
function css(hljs) {
const regex = hljs.regex;
const modes = MODES(hljs);
const VENDOR_PREFIX = {
begin: /-(webkit|moz|ms|o)-(?=[a-z])/
};
const AT_MODIFIERS = "and or not only";
const AT_PROPERTY_RE = /@-?\w[\w]*(-\w+)*/; // @-webkit-keyframes
const IDENT_RE = '[a-zA-Z-][a-zA-Z0-9_-]*';
const STRINGS = [
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE
];
return {
name: 'CSS',
case_insensitive: true,
illegal: /[=|'\$]/,
keywords: {
keyframePosition: "from to"
},
classNameAliases: {
// for visual continuity with `tag {}` and because we
// don't have a great class for this?
keyframePosition: "selector-tag"
},
contains: [
modes.BLOCK_COMMENT,
VENDOR_PREFIX,
// to recognize keyframe 40% etc which are outside the scope of our
// attribute value mode
modes.CSS_NUMBER_MODE,
{
className: 'selector-id',
begin: /#[A-Za-z0-9_-]+/,
relevance: 0
},
{
className: 'selector-class',
begin: '\\.' + IDENT_RE,
relevance: 0
},
modes.ATTRIBUTE_SELECTOR_MODE,
{
className: 'selector-pseudo',
variants: [
{
begin: ':(' + PSEUDO_CLASSES.join('|') + ')'
},
{
begin: ':(:)?(' + PSEUDO_ELEMENTS.join('|') + ')'
}
]
},
// we may actually need this (12/2020)
// { // pseudo-selector params
// begin: /\(/,
// end: /\)/,
// contains: [ hljs.CSS_NUMBER_MODE ]
// },
modes.CSS_VARIABLE,
{
className: 'attribute',
begin: '\\b(' + ATTRIBUTES.join('|') + ')\\b'
},
// attribute values
{
begin: /:/,
end: /[;}{]/,
contains: [
modes.BLOCK_COMMENT,
modes.HEXCOLOR,
modes.IMPORTANT,
modes.CSS_NUMBER_MODE,
...STRINGS,
// needed to highlight these as strings and to avoid issues with
// illegal characters that might be inside urls that would tigger the
// languages illegal stack
{
begin: /(url|data-uri)\(/,
end: /\)/,
relevance: 0, // from keywords
keywords: {
built_in: "url data-uri"
},
contains: [
{
className: "string",
// any character other than `)` as in `url()` will be the start
// of a string, which ends with `)` (from the parent mode)
begin: /[^)]/,
endsWithParent: true,
excludeEnd: true
}
]
},
modes.FUNCTION_DISPATCH
]
},
{
begin: regex.lookahead(/@/),
end: '[{;]',
relevance: 0,
illegal: /:/, // break on Less variables @var: ...
contains: [
{
className: 'keyword',
begin: AT_PROPERTY_RE
},
{
begin: /\s/,
endsWithParent: true,
excludeEnd: true,
relevance: 0,
keywords: {
$pattern: /[a-z-]+/,
keyword: AT_MODIFIERS,
attribute: MEDIA_FEATURES.join(" ")
},
contains: [
{
begin: /[a-z-]+(?=:)/,
className: "attribute"
},
...STRINGS,
modes.CSS_NUMBER_MODE
]
}
]
},
{
className: 'selector-tag',
begin: '\\b(' + TAGS.join('|') + ')\\b'
}
]
};
}
module.exports = css;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/d.js":
/*!******************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/d.js ***!
\******************************************************/
/***/ ((module) => {
/*
Language: D
Author: Aleksandar Ruzicic
Description: D is a language with C-like syntax and static typing. It pragmatically combines efficiency, control, and modeling power, with safety and programmer productivity.
Version: 1.0a
Website: https://dlang.org
Date: 2012-04-08
*/
/**
* Known issues:
*
* - invalid hex string literals will be recognized as a double quoted strings
* but 'x' at the beginning of string will not be matched
*
* - delimited string literals are not checked for matching end delimiter
* (not possible to do with js regexp)
*
* - content of token string is colored as a string (i.e. no keyword coloring inside a token string)
* also, content of token string is not validated to contain only valid D tokens
*
* - special token sequence rule is not strictly following D grammar (anything following #line
* up to the end of line is matched as special token sequence)
*/
/** @type LanguageFn */
function d(hljs) {
/**
* Language keywords
*
* @type {Object}
*/
const D_KEYWORDS = {
$pattern: hljs.UNDERSCORE_IDENT_RE,
keyword:
'abstract alias align asm assert auto body break byte case cast catch class ' +
'const continue debug default delete deprecated do else enum export extern final ' +
'finally for foreach foreach_reverse|10 goto if immutable import in inout int ' +
'interface invariant is lazy macro mixin module new nothrow out override package ' +
'pragma private protected public pure ref return scope shared static struct ' +
'super switch synchronized template this throw try typedef typeid typeof union ' +
'unittest version void volatile while with __FILE__ __LINE__ __gshared|10 ' +
'__thread __traits __DATE__ __EOF__ __TIME__ __TIMESTAMP__ __VENDOR__ __VERSION__',
built_in:
'bool cdouble cent cfloat char creal dchar delegate double dstring float function ' +
'idouble ifloat ireal long real short string ubyte ucent uint ulong ushort wchar ' +
'wstring',
literal:
'false null true'
};
/**
* Number literal regexps
*
* @type {String}
*/
const decimal_integer_re = '(0|[1-9][\\d_]*)';
const decimal_integer_nosus_re = '(0|[1-9][\\d_]*|\\d[\\d_]*|[\\d_]+?\\d)';
const binary_integer_re = '0[bB][01_]+';
const hexadecimal_digits_re = '([\\da-fA-F][\\da-fA-F_]*|_[\\da-fA-F][\\da-fA-F_]*)';
const hexadecimal_integer_re = '0[xX]' + hexadecimal_digits_re;
const decimal_exponent_re = '([eE][+-]?' + decimal_integer_nosus_re + ')';
const decimal_float_re = '(' + decimal_integer_nosus_re + '(\\.\\d*|' + decimal_exponent_re + ')|' +
'\\d+\\.' + decimal_integer_nosus_re + '|' +
'\\.' + decimal_integer_re + decimal_exponent_re + '?' +
')';
const hexadecimal_float_re = '(0[xX](' +
hexadecimal_digits_re + '\\.' + hexadecimal_digits_re + '|' +
'\\.?' + hexadecimal_digits_re +
')[pP][+-]?' + decimal_integer_nosus_re + ')';
const integer_re = '(' +
decimal_integer_re + '|' +
binary_integer_re + '|' +
hexadecimal_integer_re +
')';
const float_re = '(' +
hexadecimal_float_re + '|' +
decimal_float_re +
')';
/**
* Escape sequence supported in D string and character literals
*
* @type {String}
*/
const escape_sequence_re = '\\\\(' +
'[\'"\\?\\\\abfnrtv]|' + // common escapes
'u[\\dA-Fa-f]{4}|' + // four hex digit unicode codepoint
'[0-7]{1,3}|' + // one to three octal digit ascii char code
'x[\\dA-Fa-f]{2}|' + // two hex digit ascii char code
'U[\\dA-Fa-f]{8}' + // eight hex digit unicode codepoint
')|' +
'&[a-zA-Z\\d]{2,};'; // named character entity
/**
* D integer number literals
*
* @type {Object}
*/
const D_INTEGER_MODE = {
className: 'number',
begin: '\\b' + integer_re + '(L|u|U|Lu|LU|uL|UL)?',
relevance: 0
};
/**
* [D_FLOAT_MODE description]
* @type {Object}
*/
const D_FLOAT_MODE = {
className: 'number',
begin: '\\b(' +
float_re + '([fF]|L|i|[fF]i|Li)?|' +
integer_re + '(i|[fF]i|Li)' +
')',
relevance: 0
};
/**
* D character literal
*
* @type {Object}
*/
const D_CHARACTER_MODE = {
className: 'string',
begin: '\'(' + escape_sequence_re + '|.)',
end: '\'',
illegal: '.'
};
/**
* D string escape sequence
*
* @type {Object}
*/
const D_ESCAPE_SEQUENCE = {
begin: escape_sequence_re,
relevance: 0
};
/**
* D double quoted string literal
*
* @type {Object}
*/
const D_STRING_MODE = {
className: 'string',
begin: '"',
contains: [D_ESCAPE_SEQUENCE],
end: '"[cwd]?'
};
/**
* D wysiwyg and delimited string literals
*
* @type {Object}
*/
const D_WYSIWYG_DELIMITED_STRING_MODE = {
className: 'string',
begin: '[rq]"',
end: '"[cwd]?',
relevance: 5
};
/**
* D alternate wysiwyg string literal
*
* @type {Object}
*/
const D_ALTERNATE_WYSIWYG_STRING_MODE = {
className: 'string',
begin: '`',
end: '`[cwd]?'
};
/**
* D hexadecimal string literal
*
* @type {Object}
*/
const D_HEX_STRING_MODE = {
className: 'string',
begin: 'x"[\\da-fA-F\\s\\n\\r]*"[cwd]?',
relevance: 10
};
/**
* D delimited string literal
*
* @type {Object}
*/
const D_TOKEN_STRING_MODE = {
className: 'string',
begin: 'q"\\{',
end: '\\}"'
};
/**
* Hashbang support
*
* @type {Object}
*/
const D_HASHBANG_MODE = {
className: 'meta',
begin: '^#!',
end: '$',
relevance: 5
};
/**
* D special token sequence
*
* @type {Object}
*/
const D_SPECIAL_TOKEN_SEQUENCE_MODE = {
className: 'meta',
begin: '#(line)',
end: '$',
relevance: 5
};
/**
* D attributes
*
* @type {Object}
*/
const D_ATTRIBUTE_MODE = {
className: 'keyword',
begin: '@[a-zA-Z_][a-zA-Z_\\d]*'
};
/**
* D nesting comment
*
* @type {Object}
*/
const D_NESTING_COMMENT_MODE = hljs.COMMENT(
'\\/\\+',
'\\+\\/',
{
contains: ['self'],
relevance: 10
}
);
return {
name: 'D',
keywords: D_KEYWORDS,
contains: [
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
D_NESTING_COMMENT_MODE,
D_HEX_STRING_MODE,
D_STRING_MODE,
D_WYSIWYG_DELIMITED_STRING_MODE,
D_ALTERNATE_WYSIWYG_STRING_MODE,
D_TOKEN_STRING_MODE,
D_FLOAT_MODE,
D_INTEGER_MODE,
D_CHARACTER_MODE,
D_HASHBANG_MODE,
D_SPECIAL_TOKEN_SEQUENCE_MODE,
D_ATTRIBUTE_MODE
]
};
}
module.exports = d;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/dart.js":
/*!*********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/dart.js ***!
\*********************************************************/
/***/ ((module) => {
/*
Language: Dart
Requires: markdown.js
Author: Maxim Dikun
Description: Dart a modern, object-oriented language developed by Google. For more information see https://www.dartlang.org/
Website: https://dart.dev
Category: scripting
*/
/** @type LanguageFn */
function dart(hljs) {
const SUBST = {
className: 'subst',
variants: [{
begin: '\\$[A-Za-z0-9_]+'
}]
};
const BRACED_SUBST = {
className: 'subst',
variants: [{
begin: /\$\{/,
end: /\}/
}],
keywords: 'true false null this is new super'
};
const STRING = {
className: 'string',
variants: [
{
begin: 'r\'\'\'',
end: '\'\'\''
},
{
begin: 'r"""',
end: '"""'
},
{
begin: 'r\'',
end: '\'',
illegal: '\\n'
},
{
begin: 'r"',
end: '"',
illegal: '\\n'
},
{
begin: '\'\'\'',
end: '\'\'\'',
contains: [
hljs.BACKSLASH_ESCAPE,
SUBST,
BRACED_SUBST
]
},
{
begin: '"""',
end: '"""',
contains: [
hljs.BACKSLASH_ESCAPE,
SUBST,
BRACED_SUBST
]
},
{
begin: '\'',
end: '\'',
illegal: '\\n',
contains: [
hljs.BACKSLASH_ESCAPE,
SUBST,
BRACED_SUBST
]
},
{
begin: '"',
end: '"',
illegal: '\\n',
contains: [
hljs.BACKSLASH_ESCAPE,
SUBST,
BRACED_SUBST
]
}
]
};
BRACED_SUBST.contains = [
hljs.C_NUMBER_MODE,
STRING
];
const BUILT_IN_TYPES = [
// dart:core
'Comparable',
'DateTime',
'Duration',
'Function',
'Iterable',
'Iterator',
'List',
'Map',
'Match',
'Object',
'Pattern',
'RegExp',
'Set',
'Stopwatch',
'String',
'StringBuffer',
'StringSink',
'Symbol',
'Type',
'Uri',
'bool',
'double',
'int',
'num',
// dart:html
'Element',
'ElementList'
];
const NULLABLE_BUILT_IN_TYPES = BUILT_IN_TYPES.map((e) => `${e}?`);
const BASIC_KEYWORDS = [
"abstract",
"as",
"assert",
"async",
"await",
"break",
"case",
"catch",
"class",
"const",
"continue",
"covariant",
"default",
"deferred",
"do",
"dynamic",
"else",
"enum",
"export",
"extends",
"extension",
"external",
"factory",
"false",
"final",
"finally",
"for",
"Function",
"get",
"hide",
"if",
"implements",
"import",
"in",
"inferface",
"is",
"late",
"library",
"mixin",
"new",
"null",
"on",
"operator",
"part",
"required",
"rethrow",
"return",
"set",
"show",
"static",
"super",
"switch",
"sync",
"this",
"throw",
"true",
"try",
"typedef",
"var",
"void",
"while",
"with",
"yield"
];
const KEYWORDS = {
keyword: BASIC_KEYWORDS,
built_in:
BUILT_IN_TYPES
.concat(NULLABLE_BUILT_IN_TYPES)
.concat([
// dart:core
'Never',
'Null',
'dynamic',
'print',
// dart:html
'document',
'querySelector',
'querySelectorAll',
'window'
]),
$pattern: /[A-Za-z][A-Za-z0-9_]*\??/
};
return {
name: 'Dart',
keywords: KEYWORDS,
contains: [
STRING,
hljs.COMMENT(
/\/\*\*(?!\/)/,
/\*\//,
{
subLanguage: 'markdown',
relevance: 0
}
),
hljs.COMMENT(
/\/{3,} ?/,
/$/, {
contains: [{
subLanguage: 'markdown',
begin: '.',
end: '$',
relevance: 0
}]
}
),
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
{
className: 'class',
beginKeywords: 'class interface',
end: /\{/,
excludeEnd: true,
contains: [
{
beginKeywords: 'extends implements'
},
hljs.UNDERSCORE_TITLE_MODE
]
},
hljs.C_NUMBER_MODE,
{
className: 'meta',
begin: '@[A-Za-z]+'
},
{
begin: '=>' // No markup, just a relevance booster
}
]
};
}
module.exports = dart;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/delphi.js":
/*!***********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/delphi.js ***!
\***********************************************************/
/***/ ((module) => {
/*
Language: Delphi
Website: https://www.embarcadero.com/products/delphi
*/
/** @type LanguageFn */
function delphi(hljs) {
const KEYWORDS = [
"exports",
"register",
"file",
"shl",
"array",
"record",
"property",
"for",
"mod",
"while",
"set",
"ally",
"label",
"uses",
"raise",
"not",
"stored",
"class",
"safecall",
"var",
"interface",
"or",
"private",
"static",
"exit",
"index",
"inherited",
"to",
"else",
"stdcall",
"override",
"shr",
"asm",
"far",
"resourcestring",
"finalization",
"packed",
"virtual",
"out",
"and",
"protected",
"library",
"do",
"xorwrite",
"goto",
"near",
"function",
"end",
"div",
"overload",
"object",
"unit",
"begin",
"string",
"on",
"inline",
"repeat",
"until",
"destructor",
"write",
"message",
"program",
"with",
"read",
"initialization",
"except",
"default",
"nil",
"if",
"case",
"cdecl",
"in",
"downto",
"threadvar",
"of",
"try",
"pascal",
"const",
"external",
"constructor",
"type",
"public",
"then",
"implementation",
"finally",
"published",
"procedure",
"absolute",
"reintroduce",
"operator",
"as",
"is",
"abstract",
"alias",
"assembler",
"bitpacked",
"break",
"continue",
"cppdecl",
"cvar",
"enumerator",
"experimental",
"platform",
"deprecated",
"unimplemented",
"dynamic",
"export",
"far16",
"forward",
"generic",
"helper",
"implements",
"interrupt",
"iochecks",
"local",
"name",
"nodefault",
"noreturn",
"nostackframe",
"oldfpccall",
"otherwise",
"saveregisters",
"softfloat",
"specialize",
"strict",
"unaligned",
"varargs"
];
const COMMENT_MODES = [
hljs.C_LINE_COMMENT_MODE,
hljs.COMMENT(/\{/, /\}/, {
relevance: 0
}),
hljs.COMMENT(/\(\*/, /\*\)/, {
relevance: 10
})
];
const DIRECTIVE = {
className: 'meta',
variants: [
{
begin: /\{\$/,
end: /\}/
},
{
begin: /\(\*\$/,
end: /\*\)/
}
]
};
const STRING = {
className: 'string',
begin: /'/,
end: /'/,
contains: [{
begin: /''/
}]
};
const NUMBER = {
className: 'number',
relevance: 0,
// Source: https://www.freepascal.org/docs-html/ref/refse6.html
variants: [
{
// Hexadecimal notation, e.g., $7F.
begin: '\\$[0-9A-Fa-f]+'
},
{
// Octal notation, e.g., &42.
begin: '&[0-7]+'
},
{
// Binary notation, e.g., %1010.
begin: '%[01]+'
}
]
};
const CHAR_STRING = {
className: 'string',
begin: /(#\d+)+/
};
const CLASS = {
begin: hljs.IDENT_RE + '\\s*=\\s*class\\s*\\(',
returnBegin: true,
contains: [hljs.TITLE_MODE]
};
const FUNCTION = {
className: 'function',
beginKeywords: 'function constructor destructor procedure',
end: /[:;]/,
keywords: 'function constructor|10 destructor|10 procedure|10',
contains: [
hljs.TITLE_MODE,
{
className: 'params',
begin: /\(/,
end: /\)/,
keywords: KEYWORDS,
contains: [
STRING,
CHAR_STRING,
DIRECTIVE
].concat(COMMENT_MODES)
},
DIRECTIVE
].concat(COMMENT_MODES)
};
return {
name: 'Delphi',
aliases: [
'dpr',
'dfm',
'pas',
'pascal'
],
case_insensitive: true,
keywords: KEYWORDS,
illegal: /"|\$[G-Zg-z]|\/\*|<\/|\|/,
contains: [
STRING,
CHAR_STRING,
hljs.NUMBER_MODE,
NUMBER,
CLASS,
FUNCTION,
DIRECTIVE
].concat(COMMENT_MODES)
};
}
module.exports = delphi;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/diff.js":
/*!*********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/diff.js ***!
\*********************************************************/
/***/ ((module) => {
/*
Language: Diff
Description: Unified and context diff
Author: Vasily Polovnyov
Website: https://www.gnu.org/software/diffutils/
Category: common
*/
/** @type LanguageFn */
function diff(hljs) {
const regex = hljs.regex;
return {
name: 'Diff',
aliases: ['patch'],
contains: [
{
className: 'meta',
relevance: 10,
match: regex.either(
/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,
/^\*\*\* +\d+,\d+ +\*\*\*\*$/,
/^--- +\d+,\d+ +----$/
)
},
{
className: 'comment',
variants: [
{
begin: regex.either(
/Index: /,
/^index/,
/={3,}/,
/^-{3}/,
/^\*{3} /,
/^\+{3}/,
/^diff --git/
),
end: /$/
},
{
match: /^\*{15}$/
}
]
},
{
className: 'addition',
begin: /^\+/,
end: /$/
},
{
className: 'deletion',
begin: /^-/,
end: /$/
},
{
className: 'addition',
begin: /^!/,
end: /$/
}
]
};
}
module.exports = diff;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/django.js":
/*!***********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/django.js ***!
\***********************************************************/
/***/ ((module) => {
/*
Language: Django
Description: Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
Requires: xml.js
Author: Ivan Sagalaev
Contributors: Ilya Baryshev
Website: https://www.djangoproject.com
Category: template
*/
/** @type LanguageFn */
function django(hljs) {
const FILTER = {
begin: /\|[A-Za-z]+:?/,
keywords: {
name:
'truncatewords removetags linebreaksbr yesno get_digit timesince random striptags ' +
'filesizeformat escape linebreaks length_is ljust rjust cut urlize fix_ampersands ' +
'title floatformat capfirst pprint divisibleby add make_list unordered_list urlencode ' +
'timeuntil urlizetrunc wordcount stringformat linenumbers slice date dictsort ' +
'dictsortreversed default_if_none pluralize lower join center default ' +
'truncatewords_html upper length phone2numeric wordwrap time addslashes slugify first ' +
'escapejs force_escape iriencode last safe safeseq truncatechars localize unlocalize ' +
'localtime utc timezone'
},
contains: [
hljs.QUOTE_STRING_MODE,
hljs.APOS_STRING_MODE
]
};
return {
name: 'Django',
aliases: ['jinja'],
case_insensitive: true,
subLanguage: 'xml',
contains: [
hljs.COMMENT(/\{%\s*comment\s*%\}/, /\{%\s*endcomment\s*%\}/),
hljs.COMMENT(/\{#/, /#\}/),
{
className: 'template-tag',
begin: /\{%/,
end: /%\}/,
contains: [{
className: 'name',
begin: /\w+/,
keywords: {
name:
'comment endcomment load templatetag ifchanged endifchanged if endif firstof for ' +
'endfor ifnotequal endifnotequal widthratio extends include spaceless ' +
'endspaceless regroup ifequal endifequal ssi now with cycle url filter ' +
'endfilter debug block endblock else autoescape endautoescape csrf_token empty elif ' +
'endwith static trans blocktrans endblocktrans get_static_prefix get_media_prefix ' +
'plural get_current_language language get_available_languages ' +
'get_current_language_bidi get_language_info get_language_info_list localize ' +
'endlocalize localtime endlocaltime timezone endtimezone get_current_timezone ' +
'verbatim'
},
starts: {
endsWithParent: true,
keywords: 'in by as',
contains: [FILTER],
relevance: 0
}
}]
},
{
className: 'template-variable',
begin: /\{\{/,
end: /\}\}/,
contains: [FILTER]
}
]
};
}
module.exports = django;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/dns.js":
/*!********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/dns.js ***!
\********************************************************/
/***/ ((module) => {
/*
Language: DNS Zone
Author: Tim Schumacher
Category: config
Website: https://en.wikipedia.org/wiki/Zone_file
*/
/** @type LanguageFn */
function dns(hljs) {
const KEYWORDS = [
"IN",
"A",
"AAAA",
"AFSDB",
"APL",
"CAA",
"CDNSKEY",
"CDS",
"CERT",
"CNAME",
"DHCID",
"DLV",
"DNAME",
"DNSKEY",
"DS",
"HIP",
"IPSECKEY",
"KEY",
"KX",
"LOC",
"MX",
"NAPTR",
"NS",
"NSEC",
"NSEC3",
"NSEC3PARAM",
"PTR",
"RRSIG",
"RP",
"SIG",
"SOA",
"SRV",
"SSHFP",
"TA",
"TKEY",
"TLSA",
"TSIG",
"TXT"
];
return {
name: 'DNS Zone',
aliases: [
'bind',
'zone'
],
keywords: KEYWORDS,
contains: [
hljs.COMMENT(';', '$', {
relevance: 0
}),
{
className: 'meta',
begin: /^\$(TTL|GENERATE|INCLUDE|ORIGIN)\b/
},
// IPv6
{
className: 'number',
begin: '((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))\\b'
},
// IPv4
{
className: 'number',
begin: '((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\b'
},
hljs.inherit(hljs.NUMBER_MODE, {
begin: /\b\d+[dhwm]?/
})
]
};
}
module.exports = dns;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/dockerfile.js":
/*!***************************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/dockerfile.js ***!
\***************************************************************/
/***/ ((module) => {
/*
Language: Dockerfile
Requires: bash.js
Author: Alexis Hénaut
Description: language definition for Dockerfile files
Website: https://docs.docker.com/engine/reference/builder/
Category: config
*/
/** @type LanguageFn */
function dockerfile(hljs) {
const KEYWORDS = [
"from",
"maintainer",
"expose",
"env",
"arg",
"user",
"onbuild",
"stopsignal"
];
return {
name: 'Dockerfile',
aliases: ['docker'],
case_insensitive: true,
keywords: KEYWORDS,
contains: [
hljs.HASH_COMMENT_MODE,
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE,
hljs.NUMBER_MODE,
{
beginKeywords: 'run cmd entrypoint volume add copy workdir label healthcheck shell',
starts: {
end: /[^\\]$/,
subLanguage: 'bash'
}
}
],
illegal: ''
};
}
module.exports = dockerfile;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/dos.js":
/*!********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/dos.js ***!
\********************************************************/
/***/ ((module) => {
/*
Language: Batch file (DOS)
Author: Alexander Makarov
Contributors: Anton Kochkov
Website: https://en.wikipedia.org/wiki/Batch_file
*/
/** @type LanguageFn */
function dos(hljs) {
const COMMENT = hljs.COMMENT(
/^\s*@?rem\b/, /$/,
{
relevance: 10
}
);
const LABEL = {
className: 'symbol',
begin: '^\\s*[A-Za-z._?][A-Za-z0-9_$#@~.?]*(:|\\s+label)',
relevance: 0
};
const KEYWORDS = [
"if",
"else",
"goto",
"for",
"in",
"do",
"call",
"exit",
"not",
"exist",
"errorlevel",
"defined",
"equ",
"neq",
"lss",
"leq",
"gtr",
"geq"
];
const BUILT_INS = [
"prn",
"nul",
"lpt3",
"lpt2",
"lpt1",
"con",
"com4",
"com3",
"com2",
"com1",
"aux",
"shift",
"cd",
"dir",
"echo",
"setlocal",
"endlocal",
"set",
"pause",
"copy",
"append",
"assoc",
"at",
"attrib",
"break",
"cacls",
"cd",
"chcp",
"chdir",
"chkdsk",
"chkntfs",
"cls",
"cmd",
"color",
"comp",
"compact",
"convert",
"date",
"dir",
"diskcomp",
"diskcopy",
"doskey",
"erase",
"fs",
"find",
"findstr",
"format",
"ftype",
"graftabl",
"help",
"keyb",
"label",
"md",
"mkdir",
"mode",
"more",
"move",
"path",
"pause",
"print",
"popd",
"pushd",
"promt",
"rd",
"recover",
"rem",
"rename",
"replace",
"restore",
"rmdir",
"shift",
"sort",
"start",
"subst",
"time",
"title",
"tree",
"type",
"ver",
"verify",
"vol",
// winutils
"ping",
"net",
"ipconfig",
"taskkill",
"xcopy",
"ren",
"del"
];
return {
name: 'Batch file (DOS)',
aliases: [
'bat',
'cmd'
],
case_insensitive: true,
illegal: /\/\*/,
keywords: {
keyword: KEYWORDS,
built_in: BUILT_INS
},
contains: [
{
className: 'variable',
begin: /%%[^ ]|%[^ ]+?%|![^ ]+?!/
},
{
className: 'function',
begin: LABEL.begin,
end: 'goto:eof',
contains: [
hljs.inherit(hljs.TITLE_MODE, {
begin: '([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*'
}),
COMMENT
]
},
{
className: 'number',
begin: '\\b\\d+',
relevance: 0
},
COMMENT
]
};
}
module.exports = dos;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/dsconfig.js":
/*!*************************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/dsconfig.js ***!
\*************************************************************/
/***/ ((module) => {
/*
Language: dsconfig
Description: dsconfig batch configuration language for LDAP directory servers
Contributors: Jacob Childress
Category: enterprise, config
*/
/** @type LanguageFn */
function dsconfig(hljs) {
const QUOTED_PROPERTY = {
className: 'string',
begin: /"/,
end: /"/
};
const APOS_PROPERTY = {
className: 'string',
begin: /'/,
end: /'/
};
const UNQUOTED_PROPERTY = {
className: 'string',
begin: /[\w\-?]+:\w+/,
end: /\W/,
relevance: 0
};
const VALUELESS_PROPERTY = {
className: 'string',
begin: /\w+(\-\w+)*/,
end: /(?=\W)/,
relevance: 0
};
return {
keywords: 'dsconfig',
contains: [
{
className: 'keyword',
begin: '^dsconfig',
end: /\s/,
excludeEnd: true,
relevance: 10
},
{
className: 'built_in',
begin: /(list|create|get|set|delete)-(\w+)/,
end: /\s/,
excludeEnd: true,
illegal: '!@#$%^&*()',
relevance: 10
},
{
className: 'built_in',
begin: /--(\w+)/,
end: /\s/,
excludeEnd: true
},
QUOTED_PROPERTY,
APOS_PROPERTY,
UNQUOTED_PROPERTY,
VALUELESS_PROPERTY,
hljs.HASH_COMMENT_MODE
]
};
}
module.exports = dsconfig;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/dts.js":
/*!********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/dts.js ***!
\********************************************************/
/***/ ((module) => {
/*
Language: Device Tree
Description: *.dts files used in the Linux kernel
Author: Martin Braun , Moritz Fischer
Website: https://elinux.org/Device_Tree_Reference
Category: config
*/
/** @type LanguageFn */
function dts(hljs) {
const STRINGS = {
className: 'string',
variants: [
hljs.inherit(hljs.QUOTE_STRING_MODE, {
begin: '((u8?|U)|L)?"'
}),
{
begin: '(u8?|U)?R"',
end: '"',
contains: [hljs.BACKSLASH_ESCAPE]
},
{
begin: '\'\\\\?.',
end: '\'',
illegal: '.'
}
]
};
const NUMBERS = {
className: 'number',
variants: [
{
begin: '\\b(\\d+(\\.\\d*)?|\\.\\d+)(u|U|l|L|ul|UL|f|F)'
},
{
begin: hljs.C_NUMBER_RE
}
],
relevance: 0
};
const PREPROCESSOR = {
className: 'meta',
begin: '#',
end: '$',
keywords: {
keyword: 'if else elif endif define undef ifdef ifndef'
},
contains: [
{
begin: /\\\n/,
relevance: 0
},
{
beginKeywords: 'include',
end: '$',
keywords: {
keyword: 'include'
},
contains: [
hljs.inherit(STRINGS, {
className: 'string'
}),
{
className: 'string',
begin: '<',
end: '>',
illegal: '\\n'
}
]
},
STRINGS,
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE
]
};
const REFERENCE = {
className: 'variable',
begin: /&[a-z\d_]*\b/
};
const KEYWORD = {
className: 'keyword',
begin: '/[a-z][a-z\\d-]*/'
};
const LABEL = {
className: 'symbol',
begin: '^\\s*[a-zA-Z_][a-zA-Z\\d_]*:'
};
const CELL_PROPERTY = {
className: 'params',
relevance: 0,
begin: '<',
end: '>',
contains: [
NUMBERS,
REFERENCE
]
};
const NODE = {
className: 'title.class',
begin: /[a-zA-Z_][a-zA-Z\d_@-]*(?=\s\{)/
};
const ROOT_NODE = {
className: 'title.class',
begin: /^\/(?=\s*\{)/,
relevance: 10
};
// TODO: `attribute` might be the right scope here, unsure
// I'm not sure if all these key names have semantic meaning or not
const ATTR_NO_VALUE = {
match: /[a-z][a-z-,]+(?=;)/,
relevance: 0,
scope: "attr"
};
const ATTR = {
relevance: 0,
match: [
/[a-z][a-z-,]+/,
/\s*/,
/=/
],
scope: {
1: "attr",
3: "operator"
}
};
const PUNC = {
scope: "punctuation",
relevance: 0,
// `};` combined is just to avoid tons of useless punctuation nodes
match: /\};|[;{}]/
};
return {
name: 'Device Tree',
contains: [
ROOT_NODE,
REFERENCE,
KEYWORD,
LABEL,
NODE,
ATTR,
ATTR_NO_VALUE,
CELL_PROPERTY,
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
NUMBERS,
STRINGS,
PREPROCESSOR,
PUNC,
{
begin: hljs.IDENT_RE + '::',
keywords: ""
}
]
};
}
module.exports = dts;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/dust.js":
/*!*********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/dust.js ***!
\*********************************************************/
/***/ ((module) => {
/*
Language: Dust
Requires: xml.js
Author: Michael Allen
Description: Matcher for dust.js templates.
Website: https://www.dustjs.com
Category: template
*/
/** @type LanguageFn */
function dust(hljs) {
const EXPRESSION_KEYWORDS = 'if eq ne lt lte gt gte select default math sep';
return {
name: 'Dust',
aliases: ['dst'],
case_insensitive: true,
subLanguage: 'xml',
contains: [
{
className: 'template-tag',
begin: /\{[#\/]/,
end: /\}/,
illegal: /;/,
contains: [{
className: 'name',
begin: /[a-zA-Z\.-]+/,
starts: {
endsWithParent: true,
relevance: 0,
contains: [hljs.QUOTE_STRING_MODE]
}
}]
},
{
className: 'template-variable',
begin: /\{/,
end: /\}/,
illegal: /;/,
keywords: EXPRESSION_KEYWORDS
}
]
};
}
module.exports = dust;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/ebnf.js":
/*!*********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/ebnf.js ***!
\*********************************************************/
/***/ ((module) => {
/*
Language: Extended Backus-Naur Form
Author: Alex McKibben
Website: https://en.wikipedia.org/wiki/Extended_Backus–Naur_form
*/
/** @type LanguageFn */
function ebnf(hljs) {
const commentMode = hljs.COMMENT(/\(\*/, /\*\)/);
const nonTerminalMode = {
className: "attribute",
begin: /^[ ]*[a-zA-Z]+([\s_-]+[a-zA-Z]+)*/
};
const specialSequenceMode = {
className: "meta",
begin: /\?.*\?/
};
const ruleBodyMode = {
begin: /=/,
end: /[.;]/,
contains: [
commentMode,
specialSequenceMode,
{
// terminals
className: 'string',
variants: [
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE,
{
begin: '`',
end: '`'
}
]
}
]
};
return {
name: 'Extended Backus-Naur Form',
illegal: /\S/,
contains: [
commentMode,
nonTerminalMode,
ruleBodyMode
]
};
}
module.exports = ebnf;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/elixir.js":
/*!***********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/elixir.js ***!
\***********************************************************/
/***/ ((module) => {
/*
Language: Elixir
Author: Josh Adams
Description: language definition for Elixir source code files (.ex and .exs). Based on ruby language support.
Category: functional
Website: https://elixir-lang.org
*/
/** @type LanguageFn */
function elixir(hljs) {
const regex = hljs.regex;
const ELIXIR_IDENT_RE = '[a-zA-Z_][a-zA-Z0-9_.]*(!|\\?)?';
const ELIXIR_METHOD_RE = '[a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?';
const KEYWORDS = [
"after",
"alias",
"and",
"case",
"catch",
"cond",
"defstruct",
"do",
"else",
"end",
"fn",
"for",
"if",
"import",
"in",
"not",
"or",
"quote",
"raise",
"receive",
"require",
"reraise",
"rescue",
"try",
"unless",
"unquote",
"unquote_splicing",
"use",
"when",
"with|0"
];
const LITERALS = [
"false",
"nil",
"true"
];
const KWS = {
$pattern: ELIXIR_IDENT_RE,
keyword: KEYWORDS,
literal: LITERALS
};
const SUBST = {
className: 'subst',
begin: /#\{/,
end: /\}/,
keywords: KWS
};
const NUMBER = {
className: 'number',
begin: '(\\b0o[0-7_]+)|(\\b0b[01_]+)|(\\b0x[0-9a-fA-F_]+)|(-?\\b[0-9][0-9_]*(\\.[0-9_]+([eE][-+]?[0-9]+)?)?)',
relevance: 0
};
// TODO: could be tightened
// https://elixir-lang.readthedocs.io/en/latest/intro/18.html
// but you also need to include closing delemeters in the escape list per
// individual sigil mode from what I can tell,
// ie: \} might or might not be an escape depending on the sigil used
const ESCAPES_RE = /\\[\s\S]/;
// const ESCAPES_RE = /\\["'\\abdefnrstv0]/;
const BACKSLASH_ESCAPE = {
match: ESCAPES_RE,
scope: "char.escape",
relevance: 0
};
const SIGIL_DELIMITERS = '[/|([{<"\']';
const SIGIL_DELIMITER_MODES = [
{
begin: /"/,
end: /"/
},
{
begin: /'/,
end: /'/
},
{
begin: /\//,
end: /\//
},
{
begin: /\|/,
end: /\|/
},
{
begin: /\(/,
end: /\)/
},
{
begin: /\[/,
end: /\]/
},
{
begin: /\{/,
end: /\}/
},
{
begin: /,
end: />/
}
];
const escapeSigilEnd = (end) => {
return {
scope: "char.escape",
begin: regex.concat(/\\/, end),
relevance: 0
};
};
const LOWERCASE_SIGIL = {
className: 'string',
begin: '~[a-z]' + '(?=' + SIGIL_DELIMITERS + ')',
contains: SIGIL_DELIMITER_MODES.map(x => hljs.inherit(x,
{
contains: [
escapeSigilEnd(x.end),
BACKSLASH_ESCAPE,
SUBST
]
}
))
};
const UPCASE_SIGIL = {
className: 'string',
begin: '~[A-Z]' + '(?=' + SIGIL_DELIMITERS + ')',
contains: SIGIL_DELIMITER_MODES.map(x => hljs.inherit(x,
{
contains: [ escapeSigilEnd(x.end) ]
}
))
};
const REGEX_SIGIL = {
className: 'regex',
variants: [
{
begin: '~r' + '(?=' + SIGIL_DELIMITERS + ')',
contains: SIGIL_DELIMITER_MODES.map(x => hljs.inherit(x,
{
end: regex.concat(x.end, /[uismxfU]{0,7}/),
contains: [
escapeSigilEnd(x.end),
BACKSLASH_ESCAPE,
SUBST
]
}
))
},
{
begin: '~R' + '(?=' + SIGIL_DELIMITERS + ')',
contains: SIGIL_DELIMITER_MODES.map(x => hljs.inherit(x,
{
end: regex.concat(x.end, /[uismxfU]{0,7}/),
contains: [ escapeSigilEnd(x.end) ]
})
)
}
]
};
const STRING = {
className: 'string',
contains: [
hljs.BACKSLASH_ESCAPE,
SUBST
],
variants: [
{
begin: /"""/,
end: /"""/
},
{
begin: /'''/,
end: /'''/
},
{
begin: /~S"""/,
end: /"""/,
contains: [] // override default
},
{
begin: /~S"/,
end: /"/,
contains: [] // override default
},
{
begin: /~S'''/,
end: /'''/,
contains: [] // override default
},
{
begin: /~S'/,
end: /'/,
contains: [] // override default
},
{
begin: /'/,
end: /'/
},
{
begin: /"/,
end: /"/
}
]
};
const FUNCTION = {
className: 'function',
beginKeywords: 'def defp defmacro defmacrop',
end: /\B\b/, // the mode is ended by the title
contains: [
hljs.inherit(hljs.TITLE_MODE, {
begin: ELIXIR_IDENT_RE,
endsParent: true
})
]
};
const CLASS = hljs.inherit(FUNCTION, {
className: 'class',
beginKeywords: 'defimpl defmodule defprotocol defrecord',
end: /\bdo\b|$|;/
});
const ELIXIR_DEFAULT_CONTAINS = [
STRING,
REGEX_SIGIL,
UPCASE_SIGIL,
LOWERCASE_SIGIL,
hljs.HASH_COMMENT_MODE,
CLASS,
FUNCTION,
{
begin: '::'
},
{
className: 'symbol',
begin: ':(?![\\s:])',
contains: [
STRING,
{
begin: ELIXIR_METHOD_RE
}
],
relevance: 0
},
{
className: 'symbol',
begin: ELIXIR_IDENT_RE + ':(?!:)',
relevance: 0
},
NUMBER,
{
className: 'variable',
begin: '(\\$\\W)|((\\$|@@?)(\\w+))'
},
{
begin: '->'
}
];
SUBST.contains = ELIXIR_DEFAULT_CONTAINS;
return {
name: 'Elixir',
aliases: ['ex', 'exs'],
keywords: KWS,
contains: ELIXIR_DEFAULT_CONTAINS
};
}
module.exports = elixir;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/elm.js":
/*!********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/elm.js ***!
\********************************************************/
/***/ ((module) => {
/*
Language: Elm
Author: Janis Voigtlaender
Website: https://elm-lang.org
Category: functional
*/
/** @type LanguageFn */
function elm(hljs) {
const COMMENT = {
variants: [
hljs.COMMENT('--', '$'),
hljs.COMMENT(
/\{-/,
/-\}/,
{
contains: ['self']
}
)
]
};
const CONSTRUCTOR = {
className: 'type',
begin: '\\b[A-Z][\\w\']*', // TODO: other constructors (built-in, infix).
relevance: 0
};
const LIST = {
begin: '\\(',
end: '\\)',
illegal: '"',
contains: [
{
className: 'type',
begin: '\\b[A-Z][\\w]*(\\((\\.\\.|,|\\w+)\\))?'
},
COMMENT
]
};
const RECORD = {
begin: /\{/,
end: /\}/,
contains: LIST.contains
};
const CHARACTER = {
className: 'string',
begin: '\'\\\\?.',
end: '\'',
illegal: '.'
};
const KEYWORDS = [
"let",
"in",
"if",
"then",
"else",
"case",
"of",
"where",
"module",
"import",
"exposing",
"type",
"alias",
"as",
"infix",
"infixl",
"infixr",
"port",
"effect",
"command",
"subscription"
];
return {
name: 'Elm',
keywords: KEYWORDS,
contains: [
// Top-level constructions.
{
beginKeywords: 'port effect module',
end: 'exposing',
keywords: 'port effect module where command subscription exposing',
contains: [
LIST,
COMMENT
],
illegal: '\\W\\.|;'
},
{
begin: 'import',
end: '$',
keywords: 'import as exposing',
contains: [
LIST,
COMMENT
],
illegal: '\\W\\.|;'
},
{
begin: 'type',
end: '$',
keywords: 'type alias',
contains: [
CONSTRUCTOR,
LIST,
RECORD,
COMMENT
]
},
{
beginKeywords: 'infix infixl infixr',
end: '$',
contains: [
hljs.C_NUMBER_MODE,
COMMENT
]
},
{
begin: 'port',
end: '$',
keywords: 'port',
contains: [COMMENT]
},
// Literals and names.
CHARACTER,
hljs.QUOTE_STRING_MODE,
hljs.C_NUMBER_MODE,
CONSTRUCTOR,
hljs.inherit(hljs.TITLE_MODE, {
begin: '^[_a-z][\\w\']*'
}),
COMMENT,
{ // No markup, relevance booster
begin: '->|<-'
}
],
illegal: /;/
};
}
module.exports = elm;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/erb.js":
/*!********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/erb.js ***!
\********************************************************/
/***/ ((module) => {
/*
Language: ERB (Embedded Ruby)
Requires: xml.js, ruby.js
Author: Lucas Mazza
Contributors: Kassio Borges
Description: "Bridge" language defining fragments of Ruby in HTML within <% .. %>
Website: https://ruby-doc.org/stdlib-2.6.5/libdoc/erb/rdoc/ERB.html
Category: template
*/
/** @type LanguageFn */
function erb(hljs) {
return {
name: 'ERB',
subLanguage: 'xml',
contains: [
hljs.COMMENT('<%#', '%>'),
{
begin: '<%[%=-]?',
end: '[%-]?%>',
subLanguage: 'ruby',
excludeBegin: true,
excludeEnd: true
}
]
};
}
module.exports = erb;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/erlang-repl.js":
/*!****************************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/erlang-repl.js ***!
\****************************************************************/
/***/ ((module) => {
/*
Language: Erlang REPL
Author: Sergey Ignatov
Website: https://www.erlang.org
Category: functional
*/
/** @type LanguageFn */
function erlangRepl(hljs) {
const regex = hljs.regex;
return {
name: 'Erlang REPL',
keywords: {
built_in:
'spawn spawn_link self',
keyword:
'after and andalso|10 band begin bnot bor bsl bsr bxor case catch cond div end fun if ' +
'let not of or orelse|10 query receive rem try when xor'
},
contains: [
{
className: 'meta',
begin: '^[0-9]+> ',
relevance: 10
},
hljs.COMMENT('%', '$'),
{
className: 'number',
begin: '\\b(\\d+(_\\d+)*#[a-fA-F0-9]+(_[a-fA-F0-9]+)*|\\d+(_\\d+)*(\\.\\d+(_\\d+)*)?([eE][-+]?\\d+)?)',
relevance: 0
},
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE,
{
begin: regex.concat(
/\?(::)?/,
/([A-Z]\w*)/, // at least one identifier
/((::)[A-Z]\w*)*/ // perhaps more
)
},
{
begin: '->'
},
{
begin: 'ok'
},
{
begin: '!'
},
{
begin: '(\\b[a-z\'][a-zA-Z0-9_\']*:[a-z\'][a-zA-Z0-9_\']*)|(\\b[a-z\'][a-zA-Z0-9_\']*)',
relevance: 0
},
{
begin: '[A-Z][a-zA-Z0-9_\']*',
relevance: 0
}
]
};
}
module.exports = erlangRepl;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/erlang.js":
/*!***********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/erlang.js ***!
\***********************************************************/
/***/ ((module) => {
/*
Language: Erlang
Description: Erlang is a general-purpose functional language, with strict evaluation, single assignment, and dynamic typing.
Author: Nikolay Zakharov , Dmitry Kovega
Website: https://www.erlang.org
Category: functional
*/
/** @type LanguageFn */
function erlang(hljs) {
const BASIC_ATOM_RE = '[a-z\'][a-zA-Z0-9_\']*';
const FUNCTION_NAME_RE = '(' + BASIC_ATOM_RE + ':' + BASIC_ATOM_RE + '|' + BASIC_ATOM_RE + ')';
const ERLANG_RESERVED = {
keyword:
'after and andalso|10 band begin bnot bor bsl bzr bxor case catch cond div end fun if ' +
'let not of orelse|10 query receive rem try when xor',
literal:
'false true'
};
const COMMENT = hljs.COMMENT('%', '$');
const NUMBER = {
className: 'number',
begin: '\\b(\\d+(_\\d+)*#[a-fA-F0-9]+(_[a-fA-F0-9]+)*|\\d+(_\\d+)*(\\.\\d+(_\\d+)*)?([eE][-+]?\\d+)?)',
relevance: 0
};
const NAMED_FUN = {
begin: 'fun\\s+' + BASIC_ATOM_RE + '/\\d+'
};
const FUNCTION_CALL = {
begin: FUNCTION_NAME_RE + '\\(',
end: '\\)',
returnBegin: true,
relevance: 0,
contains: [
{
begin: FUNCTION_NAME_RE,
relevance: 0
},
{
begin: '\\(',
end: '\\)',
endsWithParent: true,
returnEnd: true,
relevance: 0
// "contains" defined later
}
]
};
const TUPLE = {
begin: /\{/,
end: /\}/,
relevance: 0
// "contains" defined later
};
const VAR1 = {
begin: '\\b_([A-Z][A-Za-z0-9_]*)?',
relevance: 0
};
const VAR2 = {
begin: '[A-Z][a-zA-Z0-9_]*',
relevance: 0
};
const RECORD_ACCESS = {
begin: '#' + hljs.UNDERSCORE_IDENT_RE,
relevance: 0,
returnBegin: true,
contains: [
{
begin: '#' + hljs.UNDERSCORE_IDENT_RE,
relevance: 0
},
{
begin: /\{/,
end: /\}/,
relevance: 0
// "contains" defined later
}
]
};
const BLOCK_STATEMENTS = {
beginKeywords: 'fun receive if try case',
end: 'end',
keywords: ERLANG_RESERVED
};
BLOCK_STATEMENTS.contains = [
COMMENT,
NAMED_FUN,
hljs.inherit(hljs.APOS_STRING_MODE, {
className: ''
}),
BLOCK_STATEMENTS,
FUNCTION_CALL,
hljs.QUOTE_STRING_MODE,
NUMBER,
TUPLE,
VAR1,
VAR2,
RECORD_ACCESS
];
const BASIC_MODES = [
COMMENT,
NAMED_FUN,
BLOCK_STATEMENTS,
FUNCTION_CALL,
hljs.QUOTE_STRING_MODE,
NUMBER,
TUPLE,
VAR1,
VAR2,
RECORD_ACCESS
];
FUNCTION_CALL.contains[1].contains = BASIC_MODES;
TUPLE.contains = BASIC_MODES;
RECORD_ACCESS.contains[1].contains = BASIC_MODES;
const DIRECTIVES = [
"-module",
"-record",
"-undef",
"-export",
"-ifdef",
"-ifndef",
"-author",
"-copyright",
"-doc",
"-vsn",
"-import",
"-include",
"-include_lib",
"-compile",
"-define",
"-else",
"-endif",
"-file",
"-behaviour",
"-behavior",
"-spec"
];
const PARAMS = {
className: 'params',
begin: '\\(',
end: '\\)',
contains: BASIC_MODES
};
return {
name: 'Erlang',
aliases: ['erl'],
keywords: ERLANG_RESERVED,
illegal: '(|\\*=|\\+=|-=|/\\*|\\*/|\\(\\*|\\*\\))',
contains: [
{
className: 'function',
begin: '^' + BASIC_ATOM_RE + '\\s*\\(',
end: '->',
returnBegin: true,
illegal: '\\(|#|//|/\\*|\\\\|:|;',
contains: [
PARAMS,
hljs.inherit(hljs.TITLE_MODE, {
begin: BASIC_ATOM_RE
})
],
starts: {
end: ';|\\.',
keywords: ERLANG_RESERVED,
contains: BASIC_MODES
}
},
COMMENT,
{
begin: '^-',
end: '\\.',
relevance: 0,
excludeEnd: true,
returnBegin: true,
keywords: {
$pattern: '-' + hljs.IDENT_RE,
keyword: DIRECTIVES.map(x => `${x}|1.5`).join(" ")
},
contains: [PARAMS]
},
NUMBER,
hljs.QUOTE_STRING_MODE,
RECORD_ACCESS,
VAR1,
VAR2,
TUPLE,
{
begin: /\.$/
} // relevance booster
]
};
}
module.exports = erlang;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/excel.js":
/*!**********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/excel.js ***!
\**********************************************************/
/***/ ((module) => {
/*
Language: Excel formulae
Author: Victor Zhou
Description: Excel formulae
Website: https://products.office.com/en-us/excel/
*/
/** @type LanguageFn */
function excel(hljs) {
// built-in functions imported from https://web.archive.org/web/20160513042710/https://support.office.com/en-us/article/Excel-functions-alphabetical-b3944572-255d-4efb-bb96-c6d90033e188
const BUILT_INS = [
"ABS",
"ACCRINT",
"ACCRINTM",
"ACOS",
"ACOSH",
"ACOT",
"ACOTH",
"AGGREGATE",
"ADDRESS",
"AMORDEGRC",
"AMORLINC",
"AND",
"ARABIC",
"AREAS",
"ASC",
"ASIN",
"ASINH",
"ATAN",
"ATAN2",
"ATANH",
"AVEDEV",
"AVERAGE",
"AVERAGEA",
"AVERAGEIF",
"AVERAGEIFS",
"BAHTTEXT",
"BASE",
"BESSELI",
"BESSELJ",
"BESSELK",
"BESSELY",
"BETADIST",
"BETA.DIST",
"BETAINV",
"BETA.INV",
"BIN2DEC",
"BIN2HEX",
"BIN2OCT",
"BINOMDIST",
"BINOM.DIST",
"BINOM.DIST.RANGE",
"BINOM.INV",
"BITAND",
"BITLSHIFT",
"BITOR",
"BITRSHIFT",
"BITXOR",
"CALL",
"CEILING",
"CEILING.MATH",
"CEILING.PRECISE",
"CELL",
"CHAR",
"CHIDIST",
"CHIINV",
"CHITEST",
"CHISQ.DIST",
"CHISQ.DIST.RT",
"CHISQ.INV",
"CHISQ.INV.RT",
"CHISQ.TEST",
"CHOOSE",
"CLEAN",
"CODE",
"COLUMN",
"COLUMNS",
"COMBIN",
"COMBINA",
"COMPLEX",
"CONCAT",
"CONCATENATE",
"CONFIDENCE",
"CONFIDENCE.NORM",
"CONFIDENCE.T",
"CONVERT",
"CORREL",
"COS",
"COSH",
"COT",
"COTH",
"COUNT",
"COUNTA",
"COUNTBLANK",
"COUNTIF",
"COUNTIFS",
"COUPDAYBS",
"COUPDAYS",
"COUPDAYSNC",
"COUPNCD",
"COUPNUM",
"COUPPCD",
"COVAR",
"COVARIANCE.P",
"COVARIANCE.S",
"CRITBINOM",
"CSC",
"CSCH",
"CUBEKPIMEMBER",
"CUBEMEMBER",
"CUBEMEMBERPROPERTY",
"CUBERANKEDMEMBER",
"CUBESET",
"CUBESETCOUNT",
"CUBEVALUE",
"CUMIPMT",
"CUMPRINC",
"DATE",
"DATEDIF",
"DATEVALUE",
"DAVERAGE",
"DAY",
"DAYS",
"DAYS360",
"DB",
"DBCS",
"DCOUNT",
"DCOUNTA",
"DDB",
"DEC2BIN",
"DEC2HEX",
"DEC2OCT",
"DECIMAL",
"DEGREES",
"DELTA",
"DEVSQ",
"DGET",
"DISC",
"DMAX",
"DMIN",
"DOLLAR",
"DOLLARDE",
"DOLLARFR",
"DPRODUCT",
"DSTDEV",
"DSTDEVP",
"DSUM",
"DURATION",
"DVAR",
"DVARP",
"EDATE",
"EFFECT",
"ENCODEURL",
"EOMONTH",
"ERF",
"ERF.PRECISE",
"ERFC",
"ERFC.PRECISE",
"ERROR.TYPE",
"EUROCONVERT",
"EVEN",
"EXACT",
"EXP",
"EXPON.DIST",
"EXPONDIST",
"FACT",
"FACTDOUBLE",
"FALSE|0",
"F.DIST",
"FDIST",
"F.DIST.RT",
"FILTERXML",
"FIND",
"FINDB",
"F.INV",
"F.INV.RT",
"FINV",
"FISHER",
"FISHERINV",
"FIXED",
"FLOOR",
"FLOOR.MATH",
"FLOOR.PRECISE",
"FORECAST",
"FORECAST.ETS",
"FORECAST.ETS.CONFINT",
"FORECAST.ETS.SEASONALITY",
"FORECAST.ETS.STAT",
"FORECAST.LINEAR",
"FORMULATEXT",
"FREQUENCY",
"F.TEST",
"FTEST",
"FV",
"FVSCHEDULE",
"GAMMA",
"GAMMA.DIST",
"GAMMADIST",
"GAMMA.INV",
"GAMMAINV",
"GAMMALN",
"GAMMALN.PRECISE",
"GAUSS",
"GCD",
"GEOMEAN",
"GESTEP",
"GETPIVOTDATA",
"GROWTH",
"HARMEAN",
"HEX2BIN",
"HEX2DEC",
"HEX2OCT",
"HLOOKUP",
"HOUR",
"HYPERLINK",
"HYPGEOM.DIST",
"HYPGEOMDIST",
"IF",
"IFERROR",
"IFNA",
"IFS",
"IMABS",
"IMAGINARY",
"IMARGUMENT",
"IMCONJUGATE",
"IMCOS",
"IMCOSH",
"IMCOT",
"IMCSC",
"IMCSCH",
"IMDIV",
"IMEXP",
"IMLN",
"IMLOG10",
"IMLOG2",
"IMPOWER",
"IMPRODUCT",
"IMREAL",
"IMSEC",
"IMSECH",
"IMSIN",
"IMSINH",
"IMSQRT",
"IMSUB",
"IMSUM",
"IMTAN",
"INDEX",
"INDIRECT",
"INFO",
"INT",
"INTERCEPT",
"INTRATE",
"IPMT",
"IRR",
"ISBLANK",
"ISERR",
"ISERROR",
"ISEVEN",
"ISFORMULA",
"ISLOGICAL",
"ISNA",
"ISNONTEXT",
"ISNUMBER",
"ISODD",
"ISREF",
"ISTEXT",
"ISO.CEILING",
"ISOWEEKNUM",
"ISPMT",
"JIS",
"KURT",
"LARGE",
"LCM",
"LEFT",
"LEFTB",
"LEN",
"LENB",
"LINEST",
"LN",
"LOG",
"LOG10",
"LOGEST",
"LOGINV",
"LOGNORM.DIST",
"LOGNORMDIST",
"LOGNORM.INV",
"LOOKUP",
"LOWER",
"MATCH",
"MAX",
"MAXA",
"MAXIFS",
"MDETERM",
"MDURATION",
"MEDIAN",
"MID",
"MIDBs",
"MIN",
"MINIFS",
"MINA",
"MINUTE",
"MINVERSE",
"MIRR",
"MMULT",
"MOD",
"MODE",
"MODE.MULT",
"MODE.SNGL",
"MONTH",
"MROUND",
"MULTINOMIAL",
"MUNIT",
"N",
"NA",
"NEGBINOM.DIST",
"NEGBINOMDIST",
"NETWORKDAYS",
"NETWORKDAYS.INTL",
"NOMINAL",
"NORM.DIST",
"NORMDIST",
"NORMINV",
"NORM.INV",
"NORM.S.DIST",
"NORMSDIST",
"NORM.S.INV",
"NORMSINV",
"NOT",
"NOW",
"NPER",
"NPV",
"NUMBERVALUE",
"OCT2BIN",
"OCT2DEC",
"OCT2HEX",
"ODD",
"ODDFPRICE",
"ODDFYIELD",
"ODDLPRICE",
"ODDLYIELD",
"OFFSET",
"OR",
"PDURATION",
"PEARSON",
"PERCENTILE.EXC",
"PERCENTILE.INC",
"PERCENTILE",
"PERCENTRANK.EXC",
"PERCENTRANK.INC",
"PERCENTRANK",
"PERMUT",
"PERMUTATIONA",
"PHI",
"PHONETIC",
"PI",
"PMT",
"POISSON.DIST",
"POISSON",
"POWER",
"PPMT",
"PRICE",
"PRICEDISC",
"PRICEMAT",
"PROB",
"PRODUCT",
"PROPER",
"PV",
"QUARTILE",
"QUARTILE.EXC",
"QUARTILE.INC",
"QUOTIENT",
"RADIANS",
"RAND",
"RANDBETWEEN",
"RANK.AVG",
"RANK.EQ",
"RANK",
"RATE",
"RECEIVED",
"REGISTER.ID",
"REPLACE",
"REPLACEB",
"REPT",
"RIGHT",
"RIGHTB",
"ROMAN",
"ROUND",
"ROUNDDOWN",
"ROUNDUP",
"ROW",
"ROWS",
"RRI",
"RSQ",
"RTD",
"SEARCH",
"SEARCHB",
"SEC",
"SECH",
"SECOND",
"SERIESSUM",
"SHEET",
"SHEETS",
"SIGN",
"SIN",
"SINH",
"SKEW",
"SKEW.P",
"SLN",
"SLOPE",
"SMALL",
"SQL.REQUEST",
"SQRT",
"SQRTPI",
"STANDARDIZE",
"STDEV",
"STDEV.P",
"STDEV.S",
"STDEVA",
"STDEVP",
"STDEVPA",
"STEYX",
"SUBSTITUTE",
"SUBTOTAL",
"SUM",
"SUMIF",
"SUMIFS",
"SUMPRODUCT",
"SUMSQ",
"SUMX2MY2",
"SUMX2PY2",
"SUMXMY2",
"SWITCH",
"SYD",
"T",
"TAN",
"TANH",
"TBILLEQ",
"TBILLPRICE",
"TBILLYIELD",
"T.DIST",
"T.DIST.2T",
"T.DIST.RT",
"TDIST",
"TEXT",
"TEXTJOIN",
"TIME",
"TIMEVALUE",
"T.INV",
"T.INV.2T",
"TINV",
"TODAY",
"TRANSPOSE",
"TREND",
"TRIM",
"TRIMMEAN",
"TRUE|0",
"TRUNC",
"T.TEST",
"TTEST",
"TYPE",
"UNICHAR",
"UNICODE",
"UPPER",
"VALUE",
"VAR",
"VAR.P",
"VAR.S",
"VARA",
"VARP",
"VARPA",
"VDB",
"VLOOKUP",
"WEBSERVICE",
"WEEKDAY",
"WEEKNUM",
"WEIBULL",
"WEIBULL.DIST",
"WORKDAY",
"WORKDAY.INTL",
"XIRR",
"XNPV",
"XOR",
"YEAR",
"YEARFRAC",
"YIELD",
"YIELDDISC",
"YIELDMAT",
"Z.TEST",
"ZTEST"
];
return {
name: 'Excel formulae',
aliases: [
'xlsx',
'xls'
],
case_insensitive: true,
keywords: {
$pattern: /[a-zA-Z][\w\.]*/,
built_in: BUILT_INS
},
contains: [
{
/* matches a beginning equal sign found in Excel formula examples */
begin: /^=/,
end: /[^=]/,
returnEnd: true,
illegal: /=/, /* only allow single equal sign at front of line */
relevance: 10
},
/* technically, there can be more than 2 letters in column names, but this prevents conflict with some keywords */
{
/* matches a reference to a single cell */
className: 'symbol',
begin: /\b[A-Z]{1,2}\d+\b/,
end: /[^\d]/,
excludeEnd: true,
relevance: 0
},
{
/* matches a reference to a range of cells */
className: 'symbol',
begin: /[A-Z]{0,2}\d*:[A-Z]{0,2}\d*/,
relevance: 0
},
hljs.BACKSLASH_ESCAPE,
hljs.QUOTE_STRING_MODE,
{
className: 'number',
begin: hljs.NUMBER_RE + '(%)?',
relevance: 0
},
/* Excel formula comments are done by putting the comment in a function call to N() */
hljs.COMMENT(/\bN\(/, /\)/,
{
excludeBegin: true,
excludeEnd: true,
illegal: /\n/
})
]
};
}
module.exports = excel;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/fix.js":
/*!********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/fix.js ***!
\********************************************************/
/***/ ((module) => {
/*
Language: FIX
Author: Brent Bradbury
*/
/** @type LanguageFn */
function fix(hljs) {
return {
name: 'FIX',
contains: [{
begin: /[^\u2401\u0001]+/,
end: /[\u2401\u0001]/,
excludeEnd: true,
returnBegin: true,
returnEnd: false,
contains: [
{
begin: /([^\u2401\u0001=]+)/,
end: /=([^\u2401\u0001=]+)/,
returnEnd: true,
returnBegin: false,
className: 'attr'
},
{
begin: /=/,
end: /([\u2401\u0001])/,
excludeEnd: true,
excludeBegin: true,
className: 'string'
}
]
}],
case_insensitive: true
};
}
module.exports = fix;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/flix.js":
/*!*********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/flix.js ***!
\*********************************************************/
/***/ ((module) => {
/*
Language: Flix
Category: functional
Author: Magnus Madsen
Website: https://flix.dev/
*/
/** @type LanguageFn */
function flix(hljs) {
const CHAR = {
className: 'string',
begin: /'(.|\\[xXuU][a-zA-Z0-9]+)'/
};
const STRING = {
className: 'string',
variants: [{
begin: '"',
end: '"'
}]
};
const NAME = {
className: 'title',
relevance: 0,
begin: /[^0-9\n\t "'(),.`{}\[\]:;][^\n\t "'(),.`{}\[\]:;]+|[^0-9\n\t "'(),.`{}\[\]:;=]/
};
const METHOD = {
className: 'function',
beginKeywords: 'def',
end: /[:={\[(\n;]/,
excludeEnd: true,
contains: [NAME]
};
return {
name: 'Flix',
keywords: {
keyword: [
"case",
"class",
"def",
"else",
"enum",
"if",
"impl",
"import",
"in",
"lat",
"rel",
"index",
"let",
"match",
"namespace",
"switch",
"type",
"yield",
"with"
],
literal: [
"true",
"false"
]
},
contains: [
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
CHAR,
STRING,
METHOD,
hljs.C_NUMBER_MODE
]
};
}
module.exports = flix;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/fortran.js":
/*!************************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/fortran.js ***!
\************************************************************/
/***/ ((module) => {
/*
Language: Fortran
Author: Anthony Scemama
Website: https://en.wikipedia.org/wiki/Fortran
Category: scientific
*/
/** @type LanguageFn */
function fortran(hljs) {
const regex = hljs.regex;
const PARAMS = {
className: 'params',
begin: '\\(',
end: '\\)'
};
const COMMENT = {
variants: [
hljs.COMMENT('!', '$', {
relevance: 0
}),
// allow FORTRAN 77 style comments
hljs.COMMENT('^C[ ]', '$', {
relevance: 0
}),
hljs.COMMENT('^C$', '$', {
relevance: 0
})
]
};
// regex in both fortran and irpf90 should match
const OPTIONAL_NUMBER_SUFFIX = /(_[a-z_\d]+)?/;
const OPTIONAL_NUMBER_EXP = /([de][+-]?\d+)?/;
const NUMBER = {
className: 'number',
variants: [
{
begin: regex.concat(/\b\d+/, /\.(\d*)/, OPTIONAL_NUMBER_EXP, OPTIONAL_NUMBER_SUFFIX)
},
{
begin: regex.concat(/\b\d+/, OPTIONAL_NUMBER_EXP, OPTIONAL_NUMBER_SUFFIX)
},
{
begin: regex.concat(/\.\d+/, OPTIONAL_NUMBER_EXP, OPTIONAL_NUMBER_SUFFIX)
}
],
relevance: 0
};
const FUNCTION_DEF = {
className: 'function',
beginKeywords: 'subroutine function program',
illegal: '[${=\\n]',
contains: [
hljs.UNDERSCORE_TITLE_MODE,
PARAMS
]
};
const STRING = {
className: 'string',
relevance: 0,
variants: [
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE
]
};
const KEYWORDS = [
"kind",
"do",
"concurrent",
"local",
"shared",
"while",
"private",
"call",
"intrinsic",
"where",
"elsewhere",
"type",
"endtype",
"endmodule",
"endselect",
"endinterface",
"end",
"enddo",
"endif",
"if",
"forall",
"endforall",
"only",
"contains",
"default",
"return",
"stop",
"then",
"block",
"endblock",
"endassociate",
"public",
"subroutine|10",
"function",
"program",
".and.",
".or.",
".not.",
".le.",
".eq.",
".ge.",
".gt.",
".lt.",
"goto",
"save",
"else",
"use",
"module",
"select",
"case",
"access",
"blank",
"direct",
"exist",
"file",
"fmt",
"form",
"formatted",
"iostat",
"name",
"named",
"nextrec",
"number",
"opened",
"rec",
"recl",
"sequential",
"status",
"unformatted",
"unit",
"continue",
"format",
"pause",
"cycle",
"exit",
"c_null_char",
"c_alert",
"c_backspace",
"c_form_feed",
"flush",
"wait",
"decimal",
"round",
"iomsg",
"synchronous",
"nopass",
"non_overridable",
"pass",
"protected",
"volatile",
"abstract",
"extends",
"import",
"non_intrinsic",
"value",
"deferred",
"generic",
"final",
"enumerator",
"class",
"associate",
"bind",
"enum",
"c_int",
"c_short",
"c_long",
"c_long_long",
"c_signed_char",
"c_size_t",
"c_int8_t",
"c_int16_t",
"c_int32_t",
"c_int64_t",
"c_int_least8_t",
"c_int_least16_t",
"c_int_least32_t",
"c_int_least64_t",
"c_int_fast8_t",
"c_int_fast16_t",
"c_int_fast32_t",
"c_int_fast64_t",
"c_intmax_t",
"C_intptr_t",
"c_float",
"c_double",
"c_long_double",
"c_float_complex",
"c_double_complex",
"c_long_double_complex",
"c_bool",
"c_char",
"c_null_ptr",
"c_null_funptr",
"c_new_line",
"c_carriage_return",
"c_horizontal_tab",
"c_vertical_tab",
"iso_c_binding",
"c_loc",
"c_funloc",
"c_associated",
"c_f_pointer",
"c_ptr",
"c_funptr",
"iso_fortran_env",
"character_storage_size",
"error_unit",
"file_storage_size",
"input_unit",
"iostat_end",
"iostat_eor",
"numeric_storage_size",
"output_unit",
"c_f_procpointer",
"ieee_arithmetic",
"ieee_support_underflow_control",
"ieee_get_underflow_mode",
"ieee_set_underflow_mode",
"newunit",
"contiguous",
"recursive",
"pad",
"position",
"action",
"delim",
"readwrite",
"eor",
"advance",
"nml",
"interface",
"procedure",
"namelist",
"include",
"sequence",
"elemental",
"pure",
"impure",
"integer",
"real",
"character",
"complex",
"logical",
"codimension",
"dimension",
"allocatable|10",
"parameter",
"external",
"implicit|10",
"none",
"double",
"precision",
"assign",
"intent",
"optional",
"pointer",
"target",
"in",
"out",
"common",
"equivalence",
"data"
];
const LITERALS = [
".False.",
".True."
];
const BUILT_INS = [
"alog",
"alog10",
"amax0",
"amax1",
"amin0",
"amin1",
"amod",
"cabs",
"ccos",
"cexp",
"clog",
"csin",
"csqrt",
"dabs",
"dacos",
"dasin",
"datan",
"datan2",
"dcos",
"dcosh",
"ddim",
"dexp",
"dint",
"dlog",
"dlog10",
"dmax1",
"dmin1",
"dmod",
"dnint",
"dsign",
"dsin",
"dsinh",
"dsqrt",
"dtan",
"dtanh",
"float",
"iabs",
"idim",
"idint",
"idnint",
"ifix",
"isign",
"max0",
"max1",
"min0",
"min1",
"sngl",
"algama",
"cdabs",
"cdcos",
"cdexp",
"cdlog",
"cdsin",
"cdsqrt",
"cqabs",
"cqcos",
"cqexp",
"cqlog",
"cqsin",
"cqsqrt",
"dcmplx",
"dconjg",
"derf",
"derfc",
"dfloat",
"dgamma",
"dimag",
"dlgama",
"iqint",
"qabs",
"qacos",
"qasin",
"qatan",
"qatan2",
"qcmplx",
"qconjg",
"qcos",
"qcosh",
"qdim",
"qerf",
"qerfc",
"qexp",
"qgamma",
"qimag",
"qlgama",
"qlog",
"qlog10",
"qmax1",
"qmin1",
"qmod",
"qnint",
"qsign",
"qsin",
"qsinh",
"qsqrt",
"qtan",
"qtanh",
"abs",
"acos",
"aimag",
"aint",
"anint",
"asin",
"atan",
"atan2",
"char",
"cmplx",
"conjg",
"cos",
"cosh",
"exp",
"ichar",
"index",
"int",
"log",
"log10",
"max",
"min",
"nint",
"sign",
"sin",
"sinh",
"sqrt",
"tan",
"tanh",
"print",
"write",
"dim",
"lge",
"lgt",
"lle",
"llt",
"mod",
"nullify",
"allocate",
"deallocate",
"adjustl",
"adjustr",
"all",
"allocated",
"any",
"associated",
"bit_size",
"btest",
"ceiling",
"count",
"cshift",
"date_and_time",
"digits",
"dot_product",
"eoshift",
"epsilon",
"exponent",
"floor",
"fraction",
"huge",
"iand",
"ibclr",
"ibits",
"ibset",
"ieor",
"ior",
"ishft",
"ishftc",
"lbound",
"len_trim",
"matmul",
"maxexponent",
"maxloc",
"maxval",
"merge",
"minexponent",
"minloc",
"minval",
"modulo",
"mvbits",
"nearest",
"pack",
"present",
"product",
"radix",
"random_number",
"random_seed",
"range",
"repeat",
"reshape",
"rrspacing",
"scale",
"scan",
"selected_int_kind",
"selected_real_kind",
"set_exponent",
"shape",
"size",
"spacing",
"spread",
"sum",
"system_clock",
"tiny",
"transpose",
"trim",
"ubound",
"unpack",
"verify",
"achar",
"iachar",
"transfer",
"dble",
"entry",
"dprod",
"cpu_time",
"command_argument_count",
"get_command",
"get_command_argument",
"get_environment_variable",
"is_iostat_end",
"ieee_arithmetic",
"ieee_support_underflow_control",
"ieee_get_underflow_mode",
"ieee_set_underflow_mode",
"is_iostat_eor",
"move_alloc",
"new_line",
"selected_char_kind",
"same_type_as",
"extends_type_of",
"acosh",
"asinh",
"atanh",
"bessel_j0",
"bessel_j1",
"bessel_jn",
"bessel_y0",
"bessel_y1",
"bessel_yn",
"erf",
"erfc",
"erfc_scaled",
"gamma",
"log_gamma",
"hypot",
"norm2",
"atomic_define",
"atomic_ref",
"execute_command_line",
"leadz",
"trailz",
"storage_size",
"merge_bits",
"bge",
"bgt",
"ble",
"blt",
"dshiftl",
"dshiftr",
"findloc",
"iall",
"iany",
"iparity",
"image_index",
"lcobound",
"ucobound",
"maskl",
"maskr",
"num_images",
"parity",
"popcnt",
"poppar",
"shifta",
"shiftl",
"shiftr",
"this_image",
"sync",
"change",
"team",
"co_broadcast",
"co_max",
"co_min",
"co_sum",
"co_reduce"
];
return {
name: 'Fortran',
case_insensitive: true,
aliases: [
'f90',
'f95'
],
keywords: {
keyword: KEYWORDS,
literal: LITERALS,
built_in: BUILT_INS
},
illegal: /\/\*/,
contains: [
STRING,
FUNCTION_DEF,
// allow `C = value` for assignments so they aren't misdetected
// as Fortran 77 style comments
{
begin: /^C\s*=(?!=)/,
relevance: 0
},
COMMENT,
NUMBER
]
};
}
module.exports = fortran;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/fsharp.js":
/*!***********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/fsharp.js ***!
\***********************************************************/
/***/ ((module) => {
/**
* @param {string} value
* @returns {RegExp}
* */
/**
* @param {RegExp | string } re
* @returns {string}
*/
function source(re) {
if (!re) return null;
if (typeof re === "string") return re;
return re.source;
}
/**
* @param {RegExp | string } re
* @returns {string}
*/
function lookahead(re) {
return concat('(?=', re, ')');
}
/**
* @param {...(RegExp | string) } args
* @returns {string}
*/
function concat(...args) {
const joined = args.map((x) => source(x)).join("");
return joined;
}
/**
* @param { Array } args
* @returns {object}
*/
function stripOptionsFromArgs(args) {
const opts = args[args.length - 1];
if (typeof opts === 'object' && opts.constructor === Object) {
args.splice(args.length - 1, 1);
return opts;
} else {
return {};
}
}
/**
* Any of the passed expresssions may match
*
* Creates a huge this | this | that | that match
* @param {(RegExp | string)[] } args
* @returns {string}
*/
function either(...args) {
/** @type { object & {capture?: boolean} } */
const opts = stripOptionsFromArgs(args);
const joined = '('
+ (opts.capture ? "" : "?:")
+ args.map((x) => source(x)).join("|") + ")";
return joined;
}
/*
Language: F#
Author: Jonas Follesø
Contributors: Troy Kershaw , Henrik Feldt , Melvyn Laïly
Website: https://docs.microsoft.com/en-us/dotnet/fsharp/
Category: functional
*/
/** @type LanguageFn */
function fsharp(hljs) {
const KEYWORDS = [
"abstract",
"and",
"as",
"assert",
"base",
"begin",
"class",
"default",
"delegate",
"do",
"done",
"downcast",
"downto",
"elif",
"else",
"end",
"exception",
"extern",
// "false", // literal
"finally",
"fixed",
"for",
"fun",
"function",
"global",
"if",
"in",
"inherit",
"inline",
"interface",
"internal",
"lazy",
"let",
"match",
"member",
"module",
"mutable",
"namespace",
"new",
// "not", // built_in
// "null", // literal
"of",
"open",
"or",
"override",
"private",
"public",
"rec",
"return",
"static",
"struct",
"then",
"to",
// "true", // literal
"try",
"type",
"upcast",
"use",
"val",
"void",
"when",
"while",
"with",
"yield"
];
const BANG_KEYWORD_MODE = {
// monad builder keywords (matches before non-bang keywords)
scope: 'keyword',
match: /\b(yield|return|let|do|match|use)!/
};
const PREPROCESSOR_KEYWORDS = [
"if",
"else",
"endif",
"line",
"nowarn",
"light",
"r",
"i",
"I",
"load",
"time",
"help",
"quit"
];
const LITERALS = [
"true",
"false",
"null",
"Some",
"None",
"Ok",
"Error",
"infinity",
"infinityf",
"nan",
"nanf"
];
const SPECIAL_IDENTIFIERS = [
"__LINE__",
"__SOURCE_DIRECTORY__",
"__SOURCE_FILE__"
];
const TYPES = [
// basic types
"bool",
"byte",
"sbyte",
"int8",
"int16",
"int32",
"uint8",
"uint16",
"uint32",
"int",
"uint",
"int64",
"uint64",
"nativeint",
"unativeint",
"decimal",
"float",
"double",
"float32",
"single",
"char",
"string",
"unit",
"bigint",
// other native types or lowercase aliases
"option",
"voption",
"list",
"array",
"seq",
"byref",
"exn",
"inref",
"nativeptr",
"obj",
"outref",
"voidptr"
];
const BUILTINS = [
// Somewhat arbitrary list of builtin functions and values.
// Most of them are declared in Microsoft.FSharp.Core
// I tried to stay relevant by adding only the most idiomatic
// and most used symbols that are not already declared as types.
"not",
"ref",
"raise",
"reraise",
"dict",
"readOnlyDict",
"set",
"enum",
"sizeof",
"typeof",
"typedefof",
"nameof",
"nullArg",
"invalidArg",
"invalidOp",
"id",
"fst",
"snd",
"ignore",
"lock",
"using",
"box",
"unbox",
"tryUnbox",
"printf",
"printfn",
"sprintf",
"eprintf",
"eprintfn",
"fprintf",
"fprintfn",
"failwith",
"failwithf"
];
const ALL_KEYWORDS = {
type: TYPES,
keyword: KEYWORDS,
literal: LITERALS,
built_in: BUILTINS,
'variable.constant': SPECIAL_IDENTIFIERS
};
// (* potentially multi-line Meta Language style comment *)
const ML_COMMENT =
hljs.COMMENT(/\(\*(?!\))/, /\*\)/, {
contains: ["self"]
});
// Either a multi-line (* Meta Language style comment *) or a single line // C style comment.
const COMMENT = {
variants: [
ML_COMMENT,
hljs.C_LINE_COMMENT_MODE,
]
};
// 'a or ^a
const GENERIC_TYPE_SYMBOL = {
match: concat(/('|\^)/, hljs.UNDERSCORE_IDENT_RE),
scope: 'symbol',
relevance: 0
};
const COMPUTATION_EXPRESSION = {
// computation expressions:
scope: 'computation-expression',
match: /\b[_a-z]\w*(?=\s*\{)/
};
const PREPROCESSOR = {
// preprocessor directives and fsi commands:
begin: [
/^\s*/,
concat(/#/, either(...PREPROCESSOR_KEYWORDS)),
/\b/
],
beginScope: { 2: 'meta' },
end: lookahead(/\s|$/)
};
// TODO: this definition is missing support for type suffixes and octal notation.
// BUG: range operator without any space is wrongly interpreted as a single number (e.g. 1..10 )
const NUMBER = {
variants: [
hljs.BINARY_NUMBER_MODE,
hljs.C_NUMBER_MODE
]
};
// All the following string definitions are potentially multi-line.
// BUG: these definitions are missing support for byte strings (suffixed with B)
// "..."
const QUOTED_STRING = {
scope: 'string',
begin: /"/,
end: /"/,
contains: [
hljs.BACKSLASH_ESCAPE
]
};
// @"..."
const VERBATIM_STRING = {
scope: 'string',
begin: /@"/,
end: /"/,
contains: [
{
match: /""/ // escaped "
},
hljs.BACKSLASH_ESCAPE
]
};
// """..."""
const TRIPLE_QUOTED_STRING = {
scope: 'string',
begin: /"""/,
end: /"""/,
relevance: 2
};
const SUBST = {
scope: 'subst',
begin: /\{/,
end: /\}/,
keywords: ALL_KEYWORDS
};
// $"...{1+1}..."
const INTERPOLATED_STRING = {
scope: 'string',
begin: /\$"/,
end: /"/,
contains: [
{
match: /\{\{/ // escaped {
},
{
match: /\}\}/ // escaped }
},
hljs.BACKSLASH_ESCAPE,
SUBST
]
};
// $@"...{1+1}..."
const INTERPOLATED_VERBATIM_STRING = {
scope: 'string',
begin: /(\$@|@\$)"/,
end: /"/,
contains: [
{
match: /\{\{/ // escaped {
},
{
match: /\}\}/ // escaped }
},
{
match: /""/
},
hljs.BACKSLASH_ESCAPE,
SUBST
]
};
// $"""...{1+1}..."""
const INTERPOLATED_TRIPLE_QUOTED_STRING = {
scope: 'string',
begin: /\$"""/,
end: /"""/,
contains: [
{
match: /\{\{/ // escaped {
},
{
match: /\}\}/ // escaped }
},
SUBST
],
relevance: 2
};
// '.'
const CHAR_LITERAL = {
scope: 'string',
match: concat(
/'/,
either(
/[^\\']/, // either a single non escaped char...
/\\(?:.|\d{3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}|U[a-fA-F\d]{8})/ // ...or an escape sequence
),
/'/
)
};
// F# allows a lot of things inside string placeholders.
// Things that don't currently seem allowed by the compiler: types definition, attributes usage.
// (Strictly speaking, some of the followings are only allowed inside triple quoted interpolated strings...)
SUBST.contains = [
INTERPOLATED_VERBATIM_STRING,
INTERPOLATED_STRING,
VERBATIM_STRING,
QUOTED_STRING,
CHAR_LITERAL,
BANG_KEYWORD_MODE,
COMMENT,
COMPUTATION_EXPRESSION,
PREPROCESSOR,
NUMBER,
GENERIC_TYPE_SYMBOL
];
const STRING = {
variants: [
INTERPOLATED_TRIPLE_QUOTED_STRING,
INTERPOLATED_VERBATIM_STRING,
INTERPOLATED_STRING,
TRIPLE_QUOTED_STRING,
VERBATIM_STRING,
QUOTED_STRING,
CHAR_LITERAL
]
};
return {
name: 'F#',
aliases: [
'fs',
'f#'
],
keywords: ALL_KEYWORDS,
illegal: /\/\*/,
classNameAliases: {
'computation-expression': 'keyword'
},
contains: [
BANG_KEYWORD_MODE,
STRING,
COMMENT,
{
// type MyType<'a> = ...
begin: [
/type/,
/\s+/,
hljs.UNDERSCORE_IDENT_RE
],
beginScope: {
1: 'keyword',
3: 'title.class'
},
end: lookahead(/\(|=|$/),
contains: [
GENERIC_TYPE_SYMBOL
]
},
{
// []
scope: 'meta',
begin: /^\s*\[,
excludeBegin: true,
end: lookahead(/>\]/),
relevance: 2,
contains: [
{
scope: 'string',
begin: /"/,
end: /"/
},
NUMBER
]
},
COMPUTATION_EXPRESSION,
PREPROCESSOR,
NUMBER,
GENERIC_TYPE_SYMBOL
]
};
}
module.exports = fsharp;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/gams.js":
/*!*********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/gams.js ***!
\*********************************************************/
/***/ ((module) => {
/*
Language: GAMS
Author: Stefan Bechert
Contributors: Oleg Efimov , Mikko Kouhia
Description: The General Algebraic Modeling System language
Website: https://www.gams.com
Category: scientific
*/
/** @type LanguageFn */
function gams(hljs) {
const regex = hljs.regex;
const KEYWORDS = {
keyword:
'abort acronym acronyms alias all and assign binary card diag display ' +
'else eq file files for free ge gt if integer le loop lt maximizing ' +
'minimizing model models ne negative no not option options or ord ' +
'positive prod put putpage puttl repeat sameas semicont semiint smax ' +
'smin solve sos1 sos2 sum system table then until using while xor yes',
literal:
'eps inf na',
built_in:
'abs arccos arcsin arctan arctan2 Beta betaReg binomial ceil centropy ' +
'cos cosh cvPower div div0 eDist entropy errorf execSeed exp fact ' +
'floor frac gamma gammaReg log logBeta logGamma log10 log2 mapVal max ' +
'min mod ncpCM ncpF ncpVUpow ncpVUsin normal pi poly power ' +
'randBinomial randLinear randTriangle round rPower sigmoid sign ' +
'signPower sin sinh slexp sllog10 slrec sqexp sqlog10 sqr sqrec sqrt ' +
'tan tanh trunc uniform uniformInt vcPower bool_and bool_eqv bool_imp ' +
'bool_not bool_or bool_xor ifThen rel_eq rel_ge rel_gt rel_le rel_lt ' +
'rel_ne gday gdow ghour gleap gmillisec gminute gmonth gsecond gyear ' +
'jdate jnow jstart jtime errorLevel execError gamsRelease gamsVersion ' +
'handleCollect handleDelete handleStatus handleSubmit heapFree ' +
'heapLimit heapSize jobHandle jobKill jobStatus jobTerminate ' +
'licenseLevel licenseStatus maxExecError sleep timeClose timeComp ' +
'timeElapsed timeExec timeStart'
};
const PARAMS = {
className: 'params',
begin: /\(/,
end: /\)/,
excludeBegin: true,
excludeEnd: true
};
const SYMBOLS = {
className: 'symbol',
variants: [
{
begin: /=[lgenxc]=/
},
{
begin: /\$/
}
]
};
const QSTR = { // One-line quoted comment string
className: 'comment',
variants: [
{
begin: '\'',
end: '\''
},
{
begin: '"',
end: '"'
}
],
illegal: '\\n',
contains: [hljs.BACKSLASH_ESCAPE]
};
const ASSIGNMENT = {
begin: '/',
end: '/',
keywords: KEYWORDS,
contains: [
QSTR,
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
hljs.QUOTE_STRING_MODE,
hljs.APOS_STRING_MODE,
hljs.C_NUMBER_MODE
]
};
const COMMENT_WORD = /[a-z0-9*=?@\\><:,()$[\]_.{}!+%^-]+/;
const DESCTEXT = { // Parameter/set/variable description text
begin: /[a-z][a-z0-9_]*(\([a-z0-9_, ]*\))?[ \t]+/,
excludeBegin: true,
end: '$',
endsWithParent: true,
contains: [
QSTR,
ASSIGNMENT,
{
className: 'comment',
// one comment word, then possibly more
begin: regex.concat(
COMMENT_WORD,
// [ ] because \s would be too broad (matching newlines)
regex.anyNumberOfTimes(regex.concat(/[ ]+/, COMMENT_WORD))
),
relevance: 0
}
]
};
return {
name: 'GAMS',
aliases: ['gms'],
case_insensitive: true,
keywords: KEYWORDS,
contains: [
hljs.COMMENT(/^\$ontext/, /^\$offtext/),
{
className: 'meta',
begin: '^\\$[a-z0-9]+',
end: '$',
returnBegin: true,
contains: [
{
className: 'keyword',
begin: '^\\$[a-z0-9]+'
}
]
},
hljs.COMMENT('^\\*', '$'),
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
hljs.QUOTE_STRING_MODE,
hljs.APOS_STRING_MODE,
// Declarations
{
beginKeywords:
'set sets parameter parameters variable variables ' +
'scalar scalars equation equations',
end: ';',
contains: [
hljs.COMMENT('^\\*', '$'),
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
hljs.QUOTE_STRING_MODE,
hljs.APOS_STRING_MODE,
ASSIGNMENT,
DESCTEXT
]
},
{ // table environment
beginKeywords: 'table',
end: ';',
returnBegin: true,
contains: [
{ // table header row
beginKeywords: 'table',
end: '$',
contains: [DESCTEXT]
},
hljs.COMMENT('^\\*', '$'),
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
hljs.QUOTE_STRING_MODE,
hljs.APOS_STRING_MODE,
hljs.C_NUMBER_MODE
// Table does not contain DESCTEXT or ASSIGNMENT
]
},
// Function definitions
{
className: 'function',
begin: /^[a-z][a-z0-9_,\-+' ()$]+\.{2}/,
returnBegin: true,
contains: [
{ // Function title
className: 'title',
begin: /^[a-z0-9_]+/
},
PARAMS,
SYMBOLS
]
},
hljs.C_NUMBER_MODE,
SYMBOLS
]
};
}
module.exports = gams;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/gauss.js":
/*!**********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/gauss.js ***!
\**********************************************************/
/***/ ((module) => {
/*
Language: GAUSS
Author: Matt Evans
Description: GAUSS Mathematical and Statistical language
Website: https://www.aptech.com
Category: scientific
*/
function gauss(hljs) {
const KEYWORDS = {
keyword: 'bool break call callexe checkinterrupt clear clearg closeall cls comlog compile ' +
'continue create debug declare delete disable dlibrary dllcall do dos ed edit else ' +
'elseif enable end endfor endif endp endo errorlog errorlogat expr external fn ' +
'for format goto gosub graph if keyword let lib library line load loadarray loadexe ' +
'loadf loadk loadm loadp loads loadx local locate loopnextindex lprint lpwidth lshow ' +
'matrix msym ndpclex new open output outwidth plot plotsym pop prcsn print ' +
'printdos proc push retp return rndcon rndmod rndmult rndseed run save saveall screen ' +
'scroll setarray show sparse stop string struct system trace trap threadfor ' +
'threadendfor threadbegin threadjoin threadstat threadend until use while winprint ' +
'ne ge le gt lt and xor or not eq eqv',
built_in: 'abs acf aconcat aeye amax amean AmericanBinomCall AmericanBinomCall_Greeks AmericanBinomCall_ImpVol ' +
'AmericanBinomPut AmericanBinomPut_Greeks AmericanBinomPut_ImpVol AmericanBSCall AmericanBSCall_Greeks ' +
'AmericanBSCall_ImpVol AmericanBSPut AmericanBSPut_Greeks AmericanBSPut_ImpVol amin amult annotationGetDefaults ' +
'annotationSetBkd annotationSetFont annotationSetLineColor annotationSetLineStyle annotationSetLineThickness ' +
'annualTradingDays arccos arcsin areshape arrayalloc arrayindex arrayinit arraytomat asciiload asclabel astd ' +
'astds asum atan atan2 atranspose axmargin balance band bandchol bandcholsol bandltsol bandrv bandsolpd bar ' +
'base10 begwind besselj bessely beta box boxcox cdfBeta cdfBetaInv cdfBinomial cdfBinomialInv cdfBvn cdfBvn2 ' +
'cdfBvn2e cdfCauchy cdfCauchyInv cdfChic cdfChii cdfChinc cdfChincInv cdfExp cdfExpInv cdfFc cdfFnc cdfFncInv ' +
'cdfGam cdfGenPareto cdfHyperGeo cdfLaplace cdfLaplaceInv cdfLogistic cdfLogisticInv cdfmControlCreate cdfMvn ' +
'cdfMvn2e cdfMvnce cdfMvne cdfMvt2e cdfMvtce cdfMvte cdfN cdfN2 cdfNc cdfNegBinomial cdfNegBinomialInv cdfNi ' +
'cdfPoisson cdfPoissonInv cdfRayleigh cdfRayleighInv cdfTc cdfTci cdfTnc cdfTvn cdfWeibull cdfWeibullInv cdir ' +
'ceil ChangeDir chdir chiBarSquare chol choldn cholsol cholup chrs close code cols colsf combinate combinated ' +
'complex con cond conj cons ConScore contour conv convertsatostr convertstrtosa corrm corrms corrvc corrx corrxs ' +
'cos cosh counts countwts crossprd crout croutp csrcol csrlin csvReadM csvReadSA cumprodc cumsumc curve cvtos ' +
'datacreate datacreatecomplex datalist dataload dataloop dataopen datasave date datestr datestring datestrymd ' +
'dayinyr dayofweek dbAddDatabase dbClose dbCommit dbCreateQuery dbExecQuery dbGetConnectOptions dbGetDatabaseName ' +
'dbGetDriverName dbGetDrivers dbGetHostName dbGetLastErrorNum dbGetLastErrorText dbGetNumericalPrecPolicy ' +
'dbGetPassword dbGetPort dbGetTableHeaders dbGetTables dbGetUserName dbHasFeature dbIsDriverAvailable dbIsOpen ' +
'dbIsOpenError dbOpen dbQueryBindValue dbQueryClear dbQueryCols dbQueryExecPrepared dbQueryFetchAllM dbQueryFetchAllSA ' +
'dbQueryFetchOneM dbQueryFetchOneSA dbQueryFinish dbQueryGetBoundValue dbQueryGetBoundValues dbQueryGetField ' +
'dbQueryGetLastErrorNum dbQueryGetLastErrorText dbQueryGetLastInsertID dbQueryGetLastQuery dbQueryGetPosition ' +
'dbQueryIsActive dbQueryIsForwardOnly dbQueryIsNull dbQueryIsSelect dbQueryIsValid dbQueryPrepare dbQueryRows ' +
'dbQuerySeek dbQuerySeekFirst dbQuerySeekLast dbQuerySeekNext dbQuerySeekPrevious dbQuerySetForwardOnly ' +
'dbRemoveDatabase dbRollback dbSetConnectOptions dbSetDatabaseName dbSetHostName dbSetNumericalPrecPolicy ' +
'dbSetPort dbSetUserName dbTransaction DeleteFile delif delrows denseToSp denseToSpRE denToZero design det detl ' +
'dfft dffti diag diagrv digamma doswin DOSWinCloseall DOSWinOpen dotfeq dotfeqmt dotfge dotfgemt dotfgt dotfgtmt ' +
'dotfle dotflemt dotflt dotfltmt dotfne dotfnemt draw drop dsCreate dstat dstatmt dstatmtControlCreate dtdate dtday ' +
'dttime dttodtv dttostr dttoutc dtvnormal dtvtodt dtvtoutc dummy dummybr dummydn eig eigh eighv eigv elapsedTradingDays ' +
'endwind envget eof eqSolve eqSolvemt eqSolvemtControlCreate eqSolvemtOutCreate eqSolveset erf erfc erfccplx erfcplx error ' +
'etdays ethsec etstr EuropeanBinomCall EuropeanBinomCall_Greeks EuropeanBinomCall_ImpVol EuropeanBinomPut ' +
'EuropeanBinomPut_Greeks EuropeanBinomPut_ImpVol EuropeanBSCall EuropeanBSCall_Greeks EuropeanBSCall_ImpVol ' +
'EuropeanBSPut EuropeanBSPut_Greeks EuropeanBSPut_ImpVol exctsmpl exec execbg exp extern eye fcheckerr fclearerr feq ' +
'feqmt fflush fft ffti fftm fftmi fftn fge fgemt fgets fgetsa fgetsat fgetst fgt fgtmt fileinfo filesa fle flemt ' +
'floor flt fltmt fmod fne fnemt fonts fopen formatcv formatnv fputs fputst fseek fstrerror ftell ftocv ftos ftostrC ' +
'gamma gammacplx gammaii gausset gdaAppend gdaCreate gdaDStat gdaDStatMat gdaGetIndex gdaGetName gdaGetNames gdaGetOrders ' +
'gdaGetType gdaGetTypes gdaGetVarInfo gdaIsCplx gdaLoad gdaPack gdaRead gdaReadByIndex gdaReadSome gdaReadSparse ' +
'gdaReadStruct gdaReportVarInfo gdaSave gdaUpdate gdaUpdateAndPack gdaVars gdaWrite gdaWrite32 gdaWriteSome getarray ' +
'getdims getf getGAUSShome getmatrix getmatrix4D getname getnamef getNextTradingDay getNextWeekDay getnr getorders ' +
'getpath getPreviousTradingDay getPreviousWeekDay getRow getscalar3D getscalar4D getTrRow getwind glm gradcplx gradMT ' +
'gradMTm gradMTT gradMTTm gradp graphprt graphset hasimag header headermt hess hessMT hessMTg hessMTgw hessMTm ' +
'hessMTmw hessMTT hessMTTg hessMTTgw hessMTTm hessMTw hessp hist histf histp hsec imag indcv indexcat indices indices2 ' +
'indicesf indicesfn indnv indsav integrate1d integrateControlCreate intgrat2 intgrat3 inthp1 inthp2 inthp3 inthp4 ' +
'inthpControlCreate intquad1 intquad2 intquad3 intrleav intrleavsa intrsect intsimp inv invpd invswp iscplx iscplxf ' +
'isden isinfnanmiss ismiss key keyav keyw lag lag1 lagn lapEighb lapEighi lapEighvb lapEighvi lapgEig lapgEigh lapgEighv ' +
'lapgEigv lapgSchur lapgSvdcst lapgSvds lapgSvdst lapSvdcusv lapSvds lapSvdusv ldlp ldlsol linSolve listwise ln lncdfbvn ' +
'lncdfbvn2 lncdfmvn lncdfn lncdfn2 lncdfnc lnfact lngammacplx lnpdfmvn lnpdfmvt lnpdfn lnpdft loadd loadstruct loadwind ' +
'loess loessmt loessmtControlCreate log loglog logx logy lower lowmat lowmat1 ltrisol lu lusol machEpsilon make makevars ' +
'makewind margin matalloc matinit mattoarray maxbytes maxc maxindc maxv maxvec mbesselei mbesselei0 mbesselei1 mbesseli ' +
'mbesseli0 mbesseli1 meanc median mergeby mergevar minc minindc minv miss missex missrv moment momentd movingave ' +
'movingaveExpwgt movingaveWgt nextindex nextn nextnevn nextwind ntos null null1 numCombinations ols olsmt olsmtControlCreate ' +
'olsqr olsqr2 olsqrmt ones optn optnevn orth outtyp pacf packedToSp packr parse pause pdfCauchy pdfChi pdfExp pdfGenPareto ' +
'pdfHyperGeo pdfLaplace pdfLogistic pdfn pdfPoisson pdfRayleigh pdfWeibull pi pinv pinvmt plotAddArrow plotAddBar plotAddBox ' +
'plotAddHist plotAddHistF plotAddHistP plotAddPolar plotAddScatter plotAddShape plotAddTextbox plotAddTS plotAddXY plotArea ' +
'plotBar plotBox plotClearLayout plotContour plotCustomLayout plotGetDefaults plotHist plotHistF plotHistP plotLayout ' +
'plotLogLog plotLogX plotLogY plotOpenWindow plotPolar plotSave plotScatter plotSetAxesPen plotSetBar plotSetBarFill ' +
'plotSetBarStacked plotSetBkdColor plotSetFill plotSetGrid plotSetLegend plotSetLineColor plotSetLineStyle plotSetLineSymbol ' +
'plotSetLineThickness plotSetNewWindow plotSetTitle plotSetWhichYAxis plotSetXAxisShow plotSetXLabel plotSetXRange ' +
'plotSetXTicInterval plotSetXTicLabel plotSetYAxisShow plotSetYLabel plotSetYRange plotSetZAxisShow plotSetZLabel ' +
'plotSurface plotTS plotXY polar polychar polyeval polygamma polyint polymake polymat polymroot polymult polyroot ' +
'pqgwin previousindex princomp printfm printfmt prodc psi putarray putf putvals pvCreate pvGetIndex pvGetParNames ' +
'pvGetParVector pvLength pvList pvPack pvPacki pvPackm pvPackmi pvPacks pvPacksi pvPacksm pvPacksmi pvPutParVector ' +
'pvTest pvUnpack QNewton QNewtonmt QNewtonmtControlCreate QNewtonmtOutCreate QNewtonSet QProg QProgmt QProgmtInCreate ' +
'qqr qqre qqrep qr qre qrep qrsol qrtsol qtyr qtyre qtyrep quantile quantiled qyr qyre qyrep qz rank rankindx readr ' +
'real reclassify reclassifyCuts recode recserar recsercp recserrc rerun rescale reshape rets rev rfft rffti rfftip rfftn ' +
'rfftnp rfftp rndBernoulli rndBeta rndBinomial rndCauchy rndChiSquare rndCon rndCreateState rndExp rndGamma rndGeo rndGumbel ' +
'rndHyperGeo rndi rndKMbeta rndKMgam rndKMi rndKMn rndKMnb rndKMp rndKMu rndKMvm rndLaplace rndLCbeta rndLCgam rndLCi rndLCn ' +
'rndLCnb rndLCp rndLCu rndLCvm rndLogNorm rndMTu rndMVn rndMVt rndn rndnb rndNegBinomial rndp rndPoisson rndRayleigh ' +
'rndStateSkip rndu rndvm rndWeibull rndWishart rotater round rows rowsf rref sampleData satostrC saved saveStruct savewind ' +
'scale scale3d scalerr scalinfnanmiss scalmiss schtoc schur searchsourcepath seekr select selif seqa seqm setdif setdifsa ' +
'setvars setvwrmode setwind shell shiftr sin singleindex sinh sleep solpd sortc sortcc sortd sorthc sorthcc sortind ' +
'sortindc sortmc sortr sortrc spBiconjGradSol spChol spConjGradSol spCreate spDenseSubmat spDiagRvMat spEigv spEye spLDL ' +
'spline spLU spNumNZE spOnes spreadSheetReadM spreadSheetReadSA spreadSheetWrite spScale spSubmat spToDense spTrTDense ' +
'spTScalar spZeros sqpSolve sqpSolveMT sqpSolveMTControlCreate sqpSolveMTlagrangeCreate sqpSolveMToutCreate sqpSolveSet ' +
'sqrt statements stdc stdsc stocv stof strcombine strindx strlen strput strrindx strsect strsplit strsplitPad strtodt ' +
'strtof strtofcplx strtriml strtrimr strtrunc strtruncl strtruncpad strtruncr submat subscat substute subvec sumc sumr ' +
'surface svd svd1 svd2 svdcusv svds svdusv sysstate tab tan tanh tempname ' +
'time timedt timestr timeutc title tkf2eps tkf2ps tocart todaydt toeplitz token topolar trapchk ' +
'trigamma trimr trunc type typecv typef union unionsa uniqindx uniqindxsa unique uniquesa upmat upmat1 upper utctodt ' +
'utctodtv utrisol vals varCovMS varCovXS varget vargetl varmall varmares varput varputl vartypef vcm vcms vcx vcxs ' +
'vec vech vecr vector vget view viewxyz vlist vnamecv volume vput vread vtypecv wait waitc walkindex where window ' +
'writer xlabel xlsGetSheetCount xlsGetSheetSize xlsGetSheetTypes xlsMakeRange xlsReadM xlsReadSA xlsWrite xlsWriteM ' +
'xlsWriteSA xpnd xtics xy xyz ylabel ytics zeros zeta zlabel ztics cdfEmpirical dot h5create h5open h5read h5readAttribute ' +
'h5write h5writeAttribute ldl plotAddErrorBar plotAddSurface plotCDFEmpirical plotSetColormap plotSetContourLabels ' +
'plotSetLegendFont plotSetTextInterpreter plotSetXTicCount plotSetYTicCount plotSetZLevels powerm strjoin sylvester ' +
'strtrim',
literal: 'DB_AFTER_LAST_ROW DB_ALL_TABLES DB_BATCH_OPERATIONS DB_BEFORE_FIRST_ROW DB_BLOB DB_EVENT_NOTIFICATIONS ' +
'DB_FINISH_QUERY DB_HIGH_PRECISION DB_LAST_INSERT_ID DB_LOW_PRECISION_DOUBLE DB_LOW_PRECISION_INT32 ' +
'DB_LOW_PRECISION_INT64 DB_LOW_PRECISION_NUMBERS DB_MULTIPLE_RESULT_SETS DB_NAMED_PLACEHOLDERS ' +
'DB_POSITIONAL_PLACEHOLDERS DB_PREPARED_QUERIES DB_QUERY_SIZE DB_SIMPLE_LOCKING DB_SYSTEM_TABLES DB_TABLES ' +
'DB_TRANSACTIONS DB_UNICODE DB_VIEWS __STDIN __STDOUT __STDERR __FILE_DIR'
};
const AT_COMMENT_MODE = hljs.COMMENT('@', '@');
const PREPROCESSOR =
{
className: 'meta',
begin: '#',
end: '$',
keywords: {
keyword: 'define definecs|10 undef ifdef ifndef iflight ifdllcall ifmac ifos2win ifunix else endif lineson linesoff srcfile srcline'
},
contains: [
{
begin: /\\\n/,
relevance: 0
},
{
beginKeywords: 'include',
end: '$',
keywords: {
keyword: 'include'
},
contains: [
{
className: 'string',
begin: '"',
end: '"',
illegal: '\\n'
}
]
},
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
AT_COMMENT_MODE
]
};
const STRUCT_TYPE =
{
begin: /\bstruct\s+/,
end: /\s/,
keywords: "struct",
contains: [
{
className: "type",
begin: hljs.UNDERSCORE_IDENT_RE,
relevance: 0
}
]
};
// only for definitions
const PARSE_PARAMS = [
{
className: 'params',
begin: /\(/,
end: /\)/,
excludeBegin: true,
excludeEnd: true,
endsWithParent: true,
relevance: 0,
contains: [
{ // dots
className: 'literal',
begin: /\.\.\./
},
hljs.C_NUMBER_MODE,
hljs.C_BLOCK_COMMENT_MODE,
AT_COMMENT_MODE,
STRUCT_TYPE
]
}
];
const FUNCTION_DEF =
{
className: "title",
begin: hljs.UNDERSCORE_IDENT_RE,
relevance: 0
};
const DEFINITION = function(beginKeywords, end, inherits) {
const mode = hljs.inherit(
{
className: "function",
beginKeywords: beginKeywords,
end: end,
excludeEnd: true,
contains: [].concat(PARSE_PARAMS)
},
inherits || {}
);
mode.contains.push(FUNCTION_DEF);
mode.contains.push(hljs.C_NUMBER_MODE);
mode.contains.push(hljs.C_BLOCK_COMMENT_MODE);
mode.contains.push(AT_COMMENT_MODE);
return mode;
};
const BUILT_IN_REF =
{ // these are explicitly named internal function calls
className: 'built_in',
begin: '\\b(' + KEYWORDS.built_in.split(' ').join('|') + ')\\b'
};
const STRING_REF =
{
className: 'string',
begin: '"',
end: '"',
contains: [hljs.BACKSLASH_ESCAPE],
relevance: 0
};
const FUNCTION_REF =
{
// className: "fn_ref",
begin: hljs.UNDERSCORE_IDENT_RE + '\\s*\\(',
returnBegin: true,
keywords: KEYWORDS,
relevance: 0,
contains: [
{
beginKeywords: KEYWORDS.keyword
},
BUILT_IN_REF,
{ // ambiguously named function calls get a relevance of 0
className: 'built_in',
begin: hljs.UNDERSCORE_IDENT_RE,
relevance: 0
}
]
};
const FUNCTION_REF_PARAMS =
{
// className: "fn_ref_params",
begin: /\(/,
end: /\)/,
relevance: 0,
keywords: {
built_in: KEYWORDS.built_in,
literal: KEYWORDS.literal
},
contains: [
hljs.C_NUMBER_MODE,
hljs.C_BLOCK_COMMENT_MODE,
AT_COMMENT_MODE,
BUILT_IN_REF,
FUNCTION_REF,
STRING_REF,
'self'
]
};
FUNCTION_REF.contains.push(FUNCTION_REF_PARAMS);
return {
name: 'GAUSS',
aliases: ['gss'],
case_insensitive: true, // language is case-insensitive
keywords: KEYWORDS,
illegal: /(\{[%#]|[%#]\}| <- )/,
contains: [
hljs.C_NUMBER_MODE,
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
AT_COMMENT_MODE,
STRING_REF,
PREPROCESSOR,
{
className: 'keyword',
begin: /\bexternal (matrix|string|array|sparse matrix|struct|proc|keyword|fn)/
},
DEFINITION('proc keyword', ';'),
DEFINITION('fn', '='),
{
beginKeywords: 'for threadfor',
end: /;/,
// end: /\(/,
relevance: 0,
contains: [
hljs.C_BLOCK_COMMENT_MODE,
AT_COMMENT_MODE,
FUNCTION_REF_PARAMS
]
},
{ // custom method guard
// excludes method names from keyword processing
variants: [
{
begin: hljs.UNDERSCORE_IDENT_RE + '\\.' + hljs.UNDERSCORE_IDENT_RE
},
{
begin: hljs.UNDERSCORE_IDENT_RE + '\\s*='
}
],
relevance: 0
},
FUNCTION_REF,
STRUCT_TYPE
]
};
}
module.exports = gauss;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/gcode.js":
/*!**********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/gcode.js ***!
\**********************************************************/
/***/ ((module) => {
/*
Language: G-code (ISO 6983)
Contributors: Adam Joseph Cook
Description: G-code syntax highlighter for Fanuc and other common CNC machine tool controls.
Website: https://www.sis.se/api/document/preview/911952/
*/
function gcode(hljs) {
const GCODE_IDENT_RE = '[A-Z_][A-Z0-9_.]*';
const GCODE_CLOSE_RE = '%';
const GCODE_KEYWORDS = {
$pattern: GCODE_IDENT_RE,
keyword: 'IF DO WHILE ENDWHILE CALL ENDIF SUB ENDSUB GOTO REPEAT ENDREPEAT ' +
'EQ LT GT NE GE LE OR XOR'
};
const GCODE_START = {
className: 'meta',
begin: '([O])([0-9]+)'
};
const NUMBER = hljs.inherit(hljs.C_NUMBER_MODE, {
begin: '([-+]?((\\.\\d+)|(\\d+)(\\.\\d*)?))|' + hljs.C_NUMBER_RE
});
const GCODE_CODE = [
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
hljs.COMMENT(/\(/, /\)/),
NUMBER,
hljs.inherit(hljs.APOS_STRING_MODE, {
illegal: null
}),
hljs.inherit(hljs.QUOTE_STRING_MODE, {
illegal: null
}),
{
className: 'name',
begin: '([G])([0-9]+\\.?[0-9]?)'
},
{
className: 'name',
begin: '([M])([0-9]+\\.?[0-9]?)'
},
{
className: 'attr',
begin: '(VC|VS|#)',
end: '(\\d+)'
},
{
className: 'attr',
begin: '(VZOFX|VZOFY|VZOFZ)'
},
{
className: 'built_in',
begin: '(ATAN|ABS|ACOS|ASIN|SIN|COS|EXP|FIX|FUP|ROUND|LN|TAN)(\\[)',
contains: [
NUMBER
],
end: '\\]'
},
{
className: 'symbol',
variants: [
{
begin: 'N',
end: '\\d+',
illegal: '\\W'
}
]
}
];
return {
name: 'G-code (ISO 6983)',
aliases: ['nc'],
// Some implementations (CNC controls) of G-code are interoperable with uppercase and lowercase letters seamlessly.
// However, most prefer all uppercase and uppercase is customary.
case_insensitive: true,
keywords: GCODE_KEYWORDS,
contains: [
{
className: 'meta',
begin: GCODE_CLOSE_RE
},
GCODE_START
].concat(GCODE_CODE)
};
}
module.exports = gcode;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/gherkin.js":
/*!************************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/gherkin.js ***!
\************************************************************/
/***/ ((module) => {
/*
Language: Gherkin
Author: Sam Pikesley (@pikesley)
Description: Gherkin is the format for cucumber specifications. It is a domain specific language which helps you to describe business behavior without the need to go into detail of implementation.
Website: https://cucumber.io/docs/gherkin/
*/
function gherkin(hljs) {
return {
name: 'Gherkin',
aliases: ['feature'],
keywords: 'Feature Background Ability Business\ Need Scenario Scenarios Scenario\ Outline Scenario\ Template Examples Given And Then But When',
contains: [
{
className: 'symbol',
begin: '\\*',
relevance: 0
},
{
className: 'meta',
begin: '@[^@\\s]+'
},
{
begin: '\\|',
end: '\\|\\w*$',
contains: [
{
className: 'string',
begin: '[^|]+'
}
]
},
{
className: 'variable',
begin: '<',
end: '>'
},
hljs.HASH_COMMENT_MODE,
{
className: 'string',
begin: '"""',
end: '"""'
},
hljs.QUOTE_STRING_MODE
]
};
}
module.exports = gherkin;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/glsl.js":
/*!*********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/glsl.js ***!
\*********************************************************/
/***/ ((module) => {
/*
Language: GLSL
Description: OpenGL Shading Language
Author: Sergey Tikhomirov
Website: https://en.wikipedia.org/wiki/OpenGL_Shading_Language
Category: graphics
*/
function glsl(hljs) {
return {
name: 'GLSL',
keywords: {
keyword:
// Statements
'break continue discard do else for if return while switch case default ' +
// Qualifiers
'attribute binding buffer ccw centroid centroid varying coherent column_major const cw ' +
'depth_any depth_greater depth_less depth_unchanged early_fragment_tests equal_spacing ' +
'flat fractional_even_spacing fractional_odd_spacing highp in index inout invariant ' +
'invocations isolines layout line_strip lines lines_adjacency local_size_x local_size_y ' +
'local_size_z location lowp max_vertices mediump noperspective offset origin_upper_left ' +
'out packed patch pixel_center_integer point_mode points precise precision quads r11f_g11f_b10f ' +
'r16 r16_snorm r16f r16i r16ui r32f r32i r32ui r8 r8_snorm r8i r8ui readonly restrict ' +
'rg16 rg16_snorm rg16f rg16i rg16ui rg32f rg32i rg32ui rg8 rg8_snorm rg8i rg8ui rgb10_a2 ' +
'rgb10_a2ui rgba16 rgba16_snorm rgba16f rgba16i rgba16ui rgba32f rgba32i rgba32ui rgba8 ' +
'rgba8_snorm rgba8i rgba8ui row_major sample shared smooth std140 std430 stream triangle_strip ' +
'triangles triangles_adjacency uniform varying vertices volatile writeonly',
type:
'atomic_uint bool bvec2 bvec3 bvec4 dmat2 dmat2x2 dmat2x3 dmat2x4 dmat3 dmat3x2 dmat3x3 ' +
'dmat3x4 dmat4 dmat4x2 dmat4x3 dmat4x4 double dvec2 dvec3 dvec4 float iimage1D iimage1DArray ' +
'iimage2D iimage2DArray iimage2DMS iimage2DMSArray iimage2DRect iimage3D iimageBuffer ' +
'iimageCube iimageCubeArray image1D image1DArray image2D image2DArray image2DMS image2DMSArray ' +
'image2DRect image3D imageBuffer imageCube imageCubeArray int isampler1D isampler1DArray ' +
'isampler2D isampler2DArray isampler2DMS isampler2DMSArray isampler2DRect isampler3D ' +
'isamplerBuffer isamplerCube isamplerCubeArray ivec2 ivec3 ivec4 mat2 mat2x2 mat2x3 ' +
'mat2x4 mat3 mat3x2 mat3x3 mat3x4 mat4 mat4x2 mat4x3 mat4x4 sampler1D sampler1DArray ' +
'sampler1DArrayShadow sampler1DShadow sampler2D sampler2DArray sampler2DArrayShadow ' +
'sampler2DMS sampler2DMSArray sampler2DRect sampler2DRectShadow sampler2DShadow sampler3D ' +
'samplerBuffer samplerCube samplerCubeArray samplerCubeArrayShadow samplerCubeShadow ' +
'image1D uimage1DArray uimage2D uimage2DArray uimage2DMS uimage2DMSArray uimage2DRect ' +
'uimage3D uimageBuffer uimageCube uimageCubeArray uint usampler1D usampler1DArray ' +
'usampler2D usampler2DArray usampler2DMS usampler2DMSArray usampler2DRect usampler3D ' +
'samplerBuffer usamplerCube usamplerCubeArray uvec2 uvec3 uvec4 vec2 vec3 vec4 void',
built_in:
// Constants
'gl_MaxAtomicCounterBindings gl_MaxAtomicCounterBufferSize gl_MaxClipDistances gl_MaxClipPlanes ' +
'gl_MaxCombinedAtomicCounterBuffers gl_MaxCombinedAtomicCounters gl_MaxCombinedImageUniforms ' +
'gl_MaxCombinedImageUnitsAndFragmentOutputs gl_MaxCombinedTextureImageUnits gl_MaxComputeAtomicCounterBuffers ' +
'gl_MaxComputeAtomicCounters gl_MaxComputeImageUniforms gl_MaxComputeTextureImageUnits ' +
'gl_MaxComputeUniformComponents gl_MaxComputeWorkGroupCount gl_MaxComputeWorkGroupSize ' +
'gl_MaxDrawBuffers gl_MaxFragmentAtomicCounterBuffers gl_MaxFragmentAtomicCounters ' +
'gl_MaxFragmentImageUniforms gl_MaxFragmentInputComponents gl_MaxFragmentInputVectors ' +
'gl_MaxFragmentUniformComponents gl_MaxFragmentUniformVectors gl_MaxGeometryAtomicCounterBuffers ' +
'gl_MaxGeometryAtomicCounters gl_MaxGeometryImageUniforms gl_MaxGeometryInputComponents ' +
'gl_MaxGeometryOutputComponents gl_MaxGeometryOutputVertices gl_MaxGeometryTextureImageUnits ' +
'gl_MaxGeometryTotalOutputComponents gl_MaxGeometryUniformComponents gl_MaxGeometryVaryingComponents ' +
'gl_MaxImageSamples gl_MaxImageUnits gl_MaxLights gl_MaxPatchVertices gl_MaxProgramTexelOffset ' +
'gl_MaxTessControlAtomicCounterBuffers gl_MaxTessControlAtomicCounters gl_MaxTessControlImageUniforms ' +
'gl_MaxTessControlInputComponents gl_MaxTessControlOutputComponents gl_MaxTessControlTextureImageUnits ' +
'gl_MaxTessControlTotalOutputComponents gl_MaxTessControlUniformComponents ' +
'gl_MaxTessEvaluationAtomicCounterBuffers gl_MaxTessEvaluationAtomicCounters ' +
'gl_MaxTessEvaluationImageUniforms gl_MaxTessEvaluationInputComponents gl_MaxTessEvaluationOutputComponents ' +
'gl_MaxTessEvaluationTextureImageUnits gl_MaxTessEvaluationUniformComponents ' +
'gl_MaxTessGenLevel gl_MaxTessPatchComponents gl_MaxTextureCoords gl_MaxTextureImageUnits ' +
'gl_MaxTextureUnits gl_MaxVaryingComponents gl_MaxVaryingFloats gl_MaxVaryingVectors ' +
'gl_MaxVertexAtomicCounterBuffers gl_MaxVertexAtomicCounters gl_MaxVertexAttribs gl_MaxVertexImageUniforms ' +
'gl_MaxVertexOutputComponents gl_MaxVertexOutputVectors gl_MaxVertexTextureImageUnits ' +
'gl_MaxVertexUniformComponents gl_MaxVertexUniformVectors gl_MaxViewports gl_MinProgramTexelOffset ' +
// Variables
'gl_BackColor gl_BackLightModelProduct gl_BackLightProduct gl_BackMaterial ' +
'gl_BackSecondaryColor gl_ClipDistance gl_ClipPlane gl_ClipVertex gl_Color ' +
'gl_DepthRange gl_EyePlaneQ gl_EyePlaneR gl_EyePlaneS gl_EyePlaneT gl_Fog gl_FogCoord ' +
'gl_FogFragCoord gl_FragColor gl_FragCoord gl_FragData gl_FragDepth gl_FrontColor ' +
'gl_FrontFacing gl_FrontLightModelProduct gl_FrontLightProduct gl_FrontMaterial ' +
'gl_FrontSecondaryColor gl_GlobalInvocationID gl_InstanceID gl_InvocationID gl_Layer gl_LightModel ' +
'gl_LightSource gl_LocalInvocationID gl_LocalInvocationIndex gl_ModelViewMatrix ' +
'gl_ModelViewMatrixInverse gl_ModelViewMatrixInverseTranspose gl_ModelViewMatrixTranspose ' +
'gl_ModelViewProjectionMatrix gl_ModelViewProjectionMatrixInverse gl_ModelViewProjectionMatrixInverseTranspose ' +
'gl_ModelViewProjectionMatrixTranspose gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 ' +
'gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 ' +
'gl_Normal gl_NormalMatrix gl_NormalScale gl_NumSamples gl_NumWorkGroups gl_ObjectPlaneQ ' +
'gl_ObjectPlaneR gl_ObjectPlaneS gl_ObjectPlaneT gl_PatchVerticesIn gl_Point gl_PointCoord ' +
'gl_PointSize gl_Position gl_PrimitiveID gl_PrimitiveIDIn gl_ProjectionMatrix gl_ProjectionMatrixInverse ' +
'gl_ProjectionMatrixInverseTranspose gl_ProjectionMatrixTranspose gl_SampleID gl_SampleMask ' +
'gl_SampleMaskIn gl_SamplePosition gl_SecondaryColor gl_TessCoord gl_TessLevelInner gl_TessLevelOuter ' +
'gl_TexCoord gl_TextureEnvColor gl_TextureMatrix gl_TextureMatrixInverse gl_TextureMatrixInverseTranspose ' +
'gl_TextureMatrixTranspose gl_Vertex gl_VertexID gl_ViewportIndex gl_WorkGroupID gl_WorkGroupSize gl_in gl_out ' +
// Functions
'EmitStreamVertex EmitVertex EndPrimitive EndStreamPrimitive abs acos acosh all any asin ' +
'asinh atan atanh atomicAdd atomicAnd atomicCompSwap atomicCounter atomicCounterDecrement ' +
'atomicCounterIncrement atomicExchange atomicMax atomicMin atomicOr atomicXor barrier ' +
'bitCount bitfieldExtract bitfieldInsert bitfieldReverse ceil clamp cos cosh cross ' +
'dFdx dFdy degrees determinant distance dot equal exp exp2 faceforward findLSB findMSB ' +
'floatBitsToInt floatBitsToUint floor fma fract frexp ftransform fwidth greaterThan ' +
'greaterThanEqual groupMemoryBarrier imageAtomicAdd imageAtomicAnd imageAtomicCompSwap ' +
'imageAtomicExchange imageAtomicMax imageAtomicMin imageAtomicOr imageAtomicXor imageLoad ' +
'imageSize imageStore imulExtended intBitsToFloat interpolateAtCentroid interpolateAtOffset ' +
'interpolateAtSample inverse inversesqrt isinf isnan ldexp length lessThan lessThanEqual log ' +
'log2 matrixCompMult max memoryBarrier memoryBarrierAtomicCounter memoryBarrierBuffer ' +
'memoryBarrierImage memoryBarrierShared min mix mod modf noise1 noise2 noise3 noise4 ' +
'normalize not notEqual outerProduct packDouble2x32 packHalf2x16 packSnorm2x16 packSnorm4x8 ' +
'packUnorm2x16 packUnorm4x8 pow radians reflect refract round roundEven shadow1D shadow1DLod ' +
'shadow1DProj shadow1DProjLod shadow2D shadow2DLod shadow2DProj shadow2DProjLod sign sin sinh ' +
'smoothstep sqrt step tan tanh texelFetch texelFetchOffset texture texture1D texture1DLod ' +
'texture1DProj texture1DProjLod texture2D texture2DLod texture2DProj texture2DProjLod ' +
'texture3D texture3DLod texture3DProj texture3DProjLod textureCube textureCubeLod ' +
'textureGather textureGatherOffset textureGatherOffsets textureGrad textureGradOffset ' +
'textureLod textureLodOffset textureOffset textureProj textureProjGrad textureProjGradOffset ' +
'textureProjLod textureProjLodOffset textureProjOffset textureQueryLevels textureQueryLod ' +
'textureSize transpose trunc uaddCarry uintBitsToFloat umulExtended unpackDouble2x32 ' +
'unpackHalf2x16 unpackSnorm2x16 unpackSnorm4x8 unpackUnorm2x16 unpackUnorm4x8 usubBorrow',
literal: 'true false'
},
illegal: '"',
contains: [
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
hljs.C_NUMBER_MODE,
{
className: 'meta',
begin: '#',
end: '$'
}
]
};
}
module.exports = glsl;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/gml.js":
/*!********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/gml.js ***!
\********************************************************/
/***/ ((module) => {
/*
Language: GML
Author: Meseta
Description: Game Maker Language for GameMaker Studio 2
Website: https://docs2.yoyogames.com
Category: scripting
*/
function gml(hljs) {
const KEYWORDS = [
"begin",
"end",
"if",
"then",
"else",
"while",
"do",
"for",
"break",
"continue",
"with",
"until",
"repeat",
"exit",
"and",
"or",
"xor",
"not",
"return",
"mod",
"div",
"switch",
"case",
"default",
"var",
"globalvar",
"enum",
"function",
"constructor",
"delete",
"#macro",
"#region",
"#endregion"
];
const BUILT_INS = [
"is_real",
"is_string",
"is_array",
"is_undefined",
"is_int32",
"is_int64",
"is_ptr",
"is_vec3",
"is_vec4",
"is_matrix",
"is_bool",
"is_method",
"is_struct",
"is_infinity",
"is_nan",
"is_numeric",
"typeof",
"variable_global_exists",
"variable_global_get",
"variable_global_set",
"variable_instance_exists",
"variable_instance_get",
"variable_instance_set",
"variable_instance_get_names",
"variable_struct_exists",
"variable_struct_get",
"variable_struct_get_names",
"variable_struct_names_count",
"variable_struct_remove",
"variable_struct_set",
"array_delete",
"array_insert",
"array_length",
"array_length_1d",
"array_length_2d",
"array_height_2d",
"array_equals",
"array_create",
"array_copy",
"array_pop",
"array_push",
"array_resize",
"array_sort",
"random",
"random_range",
"irandom",
"irandom_range",
"random_set_seed",
"random_get_seed",
"randomize",
"randomise",
"choose",
"abs",
"round",
"floor",
"ceil",
"sign",
"frac",
"sqrt",
"sqr",
"exp",
"ln",
"log2",
"log10",
"sin",
"cos",
"tan",
"arcsin",
"arccos",
"arctan",
"arctan2",
"dsin",
"dcos",
"dtan",
"darcsin",
"darccos",
"darctan",
"darctan2",
"degtorad",
"radtodeg",
"power",
"logn",
"min",
"max",
"mean",
"median",
"clamp",
"lerp",
"dot_product",
"dot_product_3d",
"dot_product_normalised",
"dot_product_3d_normalised",
"dot_product_normalized",
"dot_product_3d_normalized",
"math_set_epsilon",
"math_get_epsilon",
"angle_difference",
"point_distance_3d",
"point_distance",
"point_direction",
"lengthdir_x",
"lengthdir_y",
"real",
"string",
"int64",
"ptr",
"string_format",
"chr",
"ansi_char",
"ord",
"string_length",
"string_byte_length",
"string_pos",
"string_copy",
"string_char_at",
"string_ord_at",
"string_byte_at",
"string_set_byte_at",
"string_delete",
"string_insert",
"string_lower",
"string_upper",
"string_repeat",
"string_letters",
"string_digits",
"string_lettersdigits",
"string_replace",
"string_replace_all",
"string_count",
"string_hash_to_newline",
"clipboard_has_text",
"clipboard_set_text",
"clipboard_get_text",
"date_current_datetime",
"date_create_datetime",
"date_valid_datetime",
"date_inc_year",
"date_inc_month",
"date_inc_week",
"date_inc_day",
"date_inc_hour",
"date_inc_minute",
"date_inc_second",
"date_get_year",
"date_get_month",
"date_get_week",
"date_get_day",
"date_get_hour",
"date_get_minute",
"date_get_second",
"date_get_weekday",
"date_get_day_of_year",
"date_get_hour_of_year",
"date_get_minute_of_year",
"date_get_second_of_year",
"date_year_span",
"date_month_span",
"date_week_span",
"date_day_span",
"date_hour_span",
"date_minute_span",
"date_second_span",
"date_compare_datetime",
"date_compare_date",
"date_compare_time",
"date_date_of",
"date_time_of",
"date_datetime_string",
"date_date_string",
"date_time_string",
"date_days_in_month",
"date_days_in_year",
"date_leap_year",
"date_is_today",
"date_set_timezone",
"date_get_timezone",
"game_set_speed",
"game_get_speed",
"motion_set",
"motion_add",
"place_free",
"place_empty",
"place_meeting",
"place_snapped",
"move_random",
"move_snap",
"move_towards_point",
"move_contact_solid",
"move_contact_all",
"move_outside_solid",
"move_outside_all",
"move_bounce_solid",
"move_bounce_all",
"move_wrap",
"distance_to_point",
"distance_to_object",
"position_empty",
"position_meeting",
"path_start",
"path_end",
"mp_linear_step",
"mp_potential_step",
"mp_linear_step_object",
"mp_potential_step_object",
"mp_potential_settings",
"mp_linear_path",
"mp_potential_path",
"mp_linear_path_object",
"mp_potential_path_object",
"mp_grid_create",
"mp_grid_destroy",
"mp_grid_clear_all",
"mp_grid_clear_cell",
"mp_grid_clear_rectangle",
"mp_grid_add_cell",
"mp_grid_get_cell",
"mp_grid_add_rectangle",
"mp_grid_add_instances",
"mp_grid_path",
"mp_grid_draw",
"mp_grid_to_ds_grid",
"collision_point",
"collision_rectangle",
"collision_circle",
"collision_ellipse",
"collision_line",
"collision_point_list",
"collision_rectangle_list",
"collision_circle_list",
"collision_ellipse_list",
"collision_line_list",
"instance_position_list",
"instance_place_list",
"point_in_rectangle",
"point_in_triangle",
"point_in_circle",
"rectangle_in_rectangle",
"rectangle_in_triangle",
"rectangle_in_circle",
"instance_find",
"instance_exists",
"instance_number",
"instance_position",
"instance_nearest",
"instance_furthest",
"instance_place",
"instance_create_depth",
"instance_create_layer",
"instance_copy",
"instance_change",
"instance_destroy",
"position_destroy",
"position_change",
"instance_id_get",
"instance_deactivate_all",
"instance_deactivate_object",
"instance_deactivate_region",
"instance_activate_all",
"instance_activate_object",
"instance_activate_region",
"room_goto",
"room_goto_previous",
"room_goto_next",
"room_previous",
"room_next",
"room_restart",
"game_end",
"game_restart",
"game_load",
"game_save",
"game_save_buffer",
"game_load_buffer",
"event_perform",
"event_user",
"event_perform_object",
"event_inherited",
"show_debug_message",
"show_debug_overlay",
"debug_event",
"debug_get_callstack",
"alarm_get",
"alarm_set",
"font_texture_page_size",
"keyboard_set_map",
"keyboard_get_map",
"keyboard_unset_map",
"keyboard_check",
"keyboard_check_pressed",
"keyboard_check_released",
"keyboard_check_direct",
"keyboard_get_numlock",
"keyboard_set_numlock",
"keyboard_key_press",
"keyboard_key_release",
"keyboard_clear",
"io_clear",
"mouse_check_button",
"mouse_check_button_pressed",
"mouse_check_button_released",
"mouse_wheel_up",
"mouse_wheel_down",
"mouse_clear",
"draw_self",
"draw_sprite",
"draw_sprite_pos",
"draw_sprite_ext",
"draw_sprite_stretched",
"draw_sprite_stretched_ext",
"draw_sprite_tiled",
"draw_sprite_tiled_ext",
"draw_sprite_part",
"draw_sprite_part_ext",
"draw_sprite_general",
"draw_clear",
"draw_clear_alpha",
"draw_point",
"draw_line",
"draw_line_width",
"draw_rectangle",
"draw_roundrect",
"draw_roundrect_ext",
"draw_triangle",
"draw_circle",
"draw_ellipse",
"draw_set_circle_precision",
"draw_arrow",
"draw_button",
"draw_path",
"draw_healthbar",
"draw_getpixel",
"draw_getpixel_ext",
"draw_set_colour",
"draw_set_color",
"draw_set_alpha",
"draw_get_colour",
"draw_get_color",
"draw_get_alpha",
"merge_colour",
"make_colour_rgb",
"make_colour_hsv",
"colour_get_red",
"colour_get_green",
"colour_get_blue",
"colour_get_hue",
"colour_get_saturation",
"colour_get_value",
"merge_color",
"make_color_rgb",
"make_color_hsv",
"color_get_red",
"color_get_green",
"color_get_blue",
"color_get_hue",
"color_get_saturation",
"color_get_value",
"merge_color",
"screen_save",
"screen_save_part",
"draw_set_font",
"draw_set_halign",
"draw_set_valign",
"draw_text",
"draw_text_ext",
"string_width",
"string_height",
"string_width_ext",
"string_height_ext",
"draw_text_transformed",
"draw_text_ext_transformed",
"draw_text_colour",
"draw_text_ext_colour",
"draw_text_transformed_colour",
"draw_text_ext_transformed_colour",
"draw_text_color",
"draw_text_ext_color",
"draw_text_transformed_color",
"draw_text_ext_transformed_color",
"draw_point_colour",
"draw_line_colour",
"draw_line_width_colour",
"draw_rectangle_colour",
"draw_roundrect_colour",
"draw_roundrect_colour_ext",
"draw_triangle_colour",
"draw_circle_colour",
"draw_ellipse_colour",
"draw_point_color",
"draw_line_color",
"draw_line_width_color",
"draw_rectangle_color",
"draw_roundrect_color",
"draw_roundrect_color_ext",
"draw_triangle_color",
"draw_circle_color",
"draw_ellipse_color",
"draw_primitive_begin",
"draw_vertex",
"draw_vertex_colour",
"draw_vertex_color",
"draw_primitive_end",
"sprite_get_uvs",
"font_get_uvs",
"sprite_get_texture",
"font_get_texture",
"texture_get_width",
"texture_get_height",
"texture_get_uvs",
"draw_primitive_begin_texture",
"draw_vertex_texture",
"draw_vertex_texture_colour",
"draw_vertex_texture_color",
"texture_global_scale",
"surface_create",
"surface_create_ext",
"surface_resize",
"surface_free",
"surface_exists",
"surface_get_width",
"surface_get_height",
"surface_get_texture",
"surface_set_target",
"surface_set_target_ext",
"surface_reset_target",
"surface_depth_disable",
"surface_get_depth_disable",
"draw_surface",
"draw_surface_stretched",
"draw_surface_tiled",
"draw_surface_part",
"draw_surface_ext",
"draw_surface_stretched_ext",
"draw_surface_tiled_ext",
"draw_surface_part_ext",
"draw_surface_general",
"surface_getpixel",
"surface_getpixel_ext",
"surface_save",
"surface_save_part",
"surface_copy",
"surface_copy_part",
"application_surface_draw_enable",
"application_get_position",
"application_surface_enable",
"application_surface_is_enabled",
"display_get_width",
"display_get_height",
"display_get_orientation",
"display_get_gui_width",
"display_get_gui_height",
"display_reset",
"display_mouse_get_x",
"display_mouse_get_y",
"display_mouse_set",
"display_set_ui_visibility",
"window_set_fullscreen",
"window_get_fullscreen",
"window_set_caption",
"window_set_min_width",
"window_set_max_width",
"window_set_min_height",
"window_set_max_height",
"window_get_visible_rects",
"window_get_caption",
"window_set_cursor",
"window_get_cursor",
"window_set_colour",
"window_get_colour",
"window_set_color",
"window_get_color",
"window_set_position",
"window_set_size",
"window_set_rectangle",
"window_center",
"window_get_x",
"window_get_y",
"window_get_width",
"window_get_height",
"window_mouse_get_x",
"window_mouse_get_y",
"window_mouse_set",
"window_view_mouse_get_x",
"window_view_mouse_get_y",
"window_views_mouse_get_x",
"window_views_mouse_get_y",
"audio_listener_position",
"audio_listener_velocity",
"audio_listener_orientation",
"audio_emitter_position",
"audio_emitter_create",
"audio_emitter_free",
"audio_emitter_exists",
"audio_emitter_pitch",
"audio_emitter_velocity",
"audio_emitter_falloff",
"audio_emitter_gain",
"audio_play_sound",
"audio_play_sound_on",
"audio_play_sound_at",
"audio_stop_sound",
"audio_resume_music",
"audio_music_is_playing",
"audio_resume_sound",
"audio_pause_sound",
"audio_pause_music",
"audio_channel_num",
"audio_sound_length",
"audio_get_type",
"audio_falloff_set_model",
"audio_play_music",
"audio_stop_music",
"audio_master_gain",
"audio_music_gain",
"audio_sound_gain",
"audio_sound_pitch",
"audio_stop_all",
"audio_resume_all",
"audio_pause_all",
"audio_is_playing",
"audio_is_paused",
"audio_exists",
"audio_sound_set_track_position",
"audio_sound_get_track_position",
"audio_emitter_get_gain",
"audio_emitter_get_pitch",
"audio_emitter_get_x",
"audio_emitter_get_y",
"audio_emitter_get_z",
"audio_emitter_get_vx",
"audio_emitter_get_vy",
"audio_emitter_get_vz",
"audio_listener_set_position",
"audio_listener_set_velocity",
"audio_listener_set_orientation",
"audio_listener_get_data",
"audio_set_master_gain",
"audio_get_master_gain",
"audio_sound_get_gain",
"audio_sound_get_pitch",
"audio_get_name",
"audio_sound_set_track_position",
"audio_sound_get_track_position",
"audio_create_stream",
"audio_destroy_stream",
"audio_create_sync_group",
"audio_destroy_sync_group",
"audio_play_in_sync_group",
"audio_start_sync_group",
"audio_stop_sync_group",
"audio_pause_sync_group",
"audio_resume_sync_group",
"audio_sync_group_get_track_pos",
"audio_sync_group_debug",
"audio_sync_group_is_playing",
"audio_debug",
"audio_group_load",
"audio_group_unload",
"audio_group_is_loaded",
"audio_group_load_progress",
"audio_group_name",
"audio_group_stop_all",
"audio_group_set_gain",
"audio_create_buffer_sound",
"audio_free_buffer_sound",
"audio_create_play_queue",
"audio_free_play_queue",
"audio_queue_sound",
"audio_get_recorder_count",
"audio_get_recorder_info",
"audio_start_recording",
"audio_stop_recording",
"audio_sound_get_listener_mask",
"audio_emitter_get_listener_mask",
"audio_get_listener_mask",
"audio_sound_set_listener_mask",
"audio_emitter_set_listener_mask",
"audio_set_listener_mask",
"audio_get_listener_count",
"audio_get_listener_info",
"audio_system",
"show_message",
"show_message_async",
"clickable_add",
"clickable_add_ext",
"clickable_change",
"clickable_change_ext",
"clickable_delete",
"clickable_exists",
"clickable_set_style",
"show_question",
"show_question_async",
"get_integer",
"get_string",
"get_integer_async",
"get_string_async",
"get_login_async",
"get_open_filename",
"get_save_filename",
"get_open_filename_ext",
"get_save_filename_ext",
"show_error",
"highscore_clear",
"highscore_add",
"highscore_value",
"highscore_name",
"draw_highscore",
"sprite_exists",
"sprite_get_name",
"sprite_get_number",
"sprite_get_width",
"sprite_get_height",
"sprite_get_xoffset",
"sprite_get_yoffset",
"sprite_get_bbox_left",
"sprite_get_bbox_right",
"sprite_get_bbox_top",
"sprite_get_bbox_bottom",
"sprite_save",
"sprite_save_strip",
"sprite_set_cache_size",
"sprite_set_cache_size_ext",
"sprite_get_tpe",
"sprite_prefetch",
"sprite_prefetch_multi",
"sprite_flush",
"sprite_flush_multi",
"sprite_set_speed",
"sprite_get_speed_type",
"sprite_get_speed",
"font_exists",
"font_get_name",
"font_get_fontname",
"font_get_bold",
"font_get_italic",
"font_get_first",
"font_get_last",
"font_get_size",
"font_set_cache_size",
"path_exists",
"path_get_name",
"path_get_length",
"path_get_time",
"path_get_kind",
"path_get_closed",
"path_get_precision",
"path_get_number",
"path_get_point_x",
"path_get_point_y",
"path_get_point_speed",
"path_get_x",
"path_get_y",
"path_get_speed",
"script_exists",
"script_get_name",
"timeline_add",
"timeline_delete",
"timeline_clear",
"timeline_exists",
"timeline_get_name",
"timeline_moment_clear",
"timeline_moment_add_script",
"timeline_size",
"timeline_max_moment",
"object_exists",
"object_get_name",
"object_get_sprite",
"object_get_solid",
"object_get_visible",
"object_get_persistent",
"object_get_mask",
"object_get_parent",
"object_get_physics",
"object_is_ancestor",
"room_exists",
"room_get_name",
"sprite_set_offset",
"sprite_duplicate",
"sprite_assign",
"sprite_merge",
"sprite_add",
"sprite_replace",
"sprite_create_from_surface",
"sprite_add_from_surface",
"sprite_delete",
"sprite_set_alpha_from_sprite",
"sprite_collision_mask",
"font_add_enable_aa",
"font_add_get_enable_aa",
"font_add",
"font_add_sprite",
"font_add_sprite_ext",
"font_replace",
"font_replace_sprite",
"font_replace_sprite_ext",
"font_delete",
"path_set_kind",
"path_set_closed",
"path_set_precision",
"path_add",
"path_assign",
"path_duplicate",
"path_append",
"path_delete",
"path_add_point",
"path_insert_point",
"path_change_point",
"path_delete_point",
"path_clear_points",
"path_reverse",
"path_mirror",
"path_flip",
"path_rotate",
"path_rescale",
"path_shift",
"script_execute",
"object_set_sprite",
"object_set_solid",
"object_set_visible",
"object_set_persistent",
"object_set_mask",
"room_set_width",
"room_set_height",
"room_set_persistent",
"room_set_background_colour",
"room_set_background_color",
"room_set_view",
"room_set_viewport",
"room_get_viewport",
"room_set_view_enabled",
"room_add",
"room_duplicate",
"room_assign",
"room_instance_add",
"room_instance_clear",
"room_get_camera",
"room_set_camera",
"asset_get_index",
"asset_get_type",
"file_text_open_from_string",
"file_text_open_read",
"file_text_open_write",
"file_text_open_append",
"file_text_close",
"file_text_write_string",
"file_text_write_real",
"file_text_writeln",
"file_text_read_string",
"file_text_read_real",
"file_text_readln",
"file_text_eof",
"file_text_eoln",
"file_exists",
"file_delete",
"file_rename",
"file_copy",
"directory_exists",
"directory_create",
"directory_destroy",
"file_find_first",
"file_find_next",
"file_find_close",
"file_attributes",
"filename_name",
"filename_path",
"filename_dir",
"filename_drive",
"filename_ext",
"filename_change_ext",
"file_bin_open",
"file_bin_rewrite",
"file_bin_close",
"file_bin_position",
"file_bin_size",
"file_bin_seek",
"file_bin_write_byte",
"file_bin_read_byte",
"parameter_count",
"parameter_string",
"environment_get_variable",
"ini_open_from_string",
"ini_open",
"ini_close",
"ini_read_string",
"ini_read_real",
"ini_write_string",
"ini_write_real",
"ini_key_exists",
"ini_section_exists",
"ini_key_delete",
"ini_section_delete",
"ds_set_precision",
"ds_exists",
"ds_stack_create",
"ds_stack_destroy",
"ds_stack_clear",
"ds_stack_copy",
"ds_stack_size",
"ds_stack_empty",
"ds_stack_push",
"ds_stack_pop",
"ds_stack_top",
"ds_stack_write",
"ds_stack_read",
"ds_queue_create",
"ds_queue_destroy",
"ds_queue_clear",
"ds_queue_copy",
"ds_queue_size",
"ds_queue_empty",
"ds_queue_enqueue",
"ds_queue_dequeue",
"ds_queue_head",
"ds_queue_tail",
"ds_queue_write",
"ds_queue_read",
"ds_list_create",
"ds_list_destroy",
"ds_list_clear",
"ds_list_copy",
"ds_list_size",
"ds_list_empty",
"ds_list_add",
"ds_list_insert",
"ds_list_replace",
"ds_list_delete",
"ds_list_find_index",
"ds_list_find_value",
"ds_list_mark_as_list",
"ds_list_mark_as_map",
"ds_list_sort",
"ds_list_shuffle",
"ds_list_write",
"ds_list_read",
"ds_list_set",
"ds_map_create",
"ds_map_destroy",
"ds_map_clear",
"ds_map_copy",
"ds_map_size",
"ds_map_empty",
"ds_map_add",
"ds_map_add_list",
"ds_map_add_map",
"ds_map_replace",
"ds_map_replace_map",
"ds_map_replace_list",
"ds_map_delete",
"ds_map_exists",
"ds_map_find_value",
"ds_map_find_previous",
"ds_map_find_next",
"ds_map_find_first",
"ds_map_find_last",
"ds_map_write",
"ds_map_read",
"ds_map_secure_save",
"ds_map_secure_load",
"ds_map_secure_load_buffer",
"ds_map_secure_save_buffer",
"ds_map_set",
"ds_priority_create",
"ds_priority_destroy",
"ds_priority_clear",
"ds_priority_copy",
"ds_priority_size",
"ds_priority_empty",
"ds_priority_add",
"ds_priority_change_priority",
"ds_priority_find_priority",
"ds_priority_delete_value",
"ds_priority_delete_min",
"ds_priority_find_min",
"ds_priority_delete_max",
"ds_priority_find_max",
"ds_priority_write",
"ds_priority_read",
"ds_grid_create",
"ds_grid_destroy",
"ds_grid_copy",
"ds_grid_resize",
"ds_grid_width",
"ds_grid_height",
"ds_grid_clear",
"ds_grid_set",
"ds_grid_add",
"ds_grid_multiply",
"ds_grid_set_region",
"ds_grid_add_region",
"ds_grid_multiply_region",
"ds_grid_set_disk",
"ds_grid_add_disk",
"ds_grid_multiply_disk",
"ds_grid_set_grid_region",
"ds_grid_add_grid_region",
"ds_grid_multiply_grid_region",
"ds_grid_get",
"ds_grid_get_sum",
"ds_grid_get_max",
"ds_grid_get_min",
"ds_grid_get_mean",
"ds_grid_get_disk_sum",
"ds_grid_get_disk_min",
"ds_grid_get_disk_max",
"ds_grid_get_disk_mean",
"ds_grid_value_exists",
"ds_grid_value_x",
"ds_grid_value_y",
"ds_grid_value_disk_exists",
"ds_grid_value_disk_x",
"ds_grid_value_disk_y",
"ds_grid_shuffle",
"ds_grid_write",
"ds_grid_read",
"ds_grid_sort",
"ds_grid_set",
"ds_grid_get",
"effect_create_below",
"effect_create_above",
"effect_clear",
"part_type_create",
"part_type_destroy",
"part_type_exists",
"part_type_clear",
"part_type_shape",
"part_type_sprite",
"part_type_size",
"part_type_scale",
"part_type_orientation",
"part_type_life",
"part_type_step",
"part_type_death",
"part_type_speed",
"part_type_direction",
"part_type_gravity",
"part_type_colour1",
"part_type_colour2",
"part_type_colour3",
"part_type_colour_mix",
"part_type_colour_rgb",
"part_type_colour_hsv",
"part_type_color1",
"part_type_color2",
"part_type_color3",
"part_type_color_mix",
"part_type_color_rgb",
"part_type_color_hsv",
"part_type_alpha1",
"part_type_alpha2",
"part_type_alpha3",
"part_type_blend",
"part_system_create",
"part_system_create_layer",
"part_system_destroy",
"part_system_exists",
"part_system_clear",
"part_system_draw_order",
"part_system_depth",
"part_system_position",
"part_system_automatic_update",
"part_system_automatic_draw",
"part_system_update",
"part_system_drawit",
"part_system_get_layer",
"part_system_layer",
"part_particles_create",
"part_particles_create_colour",
"part_particles_create_color",
"part_particles_clear",
"part_particles_count",
"part_emitter_create",
"part_emitter_destroy",
"part_emitter_destroy_all",
"part_emitter_exists",
"part_emitter_clear",
"part_emitter_region",
"part_emitter_burst",
"part_emitter_stream",
"external_call",
"external_define",
"external_free",
"window_handle",
"window_device",
"matrix_get",
"matrix_set",
"matrix_build_identity",
"matrix_build",
"matrix_build_lookat",
"matrix_build_projection_ortho",
"matrix_build_projection_perspective",
"matrix_build_projection_perspective_fov",
"matrix_multiply",
"matrix_transform_vertex",
"matrix_stack_push",
"matrix_stack_pop",
"matrix_stack_multiply",
"matrix_stack_set",
"matrix_stack_clear",
"matrix_stack_top",
"matrix_stack_is_empty",
"browser_input_capture",
"os_get_config",
"os_get_info",
"os_get_language",
"os_get_region",
"os_lock_orientation",
"display_get_dpi_x",
"display_get_dpi_y",
"display_set_gui_size",
"display_set_gui_maximise",
"display_set_gui_maximize",
"device_mouse_dbclick_enable",
"display_set_timing_method",
"display_get_timing_method",
"display_set_sleep_margin",
"display_get_sleep_margin",
"virtual_key_add",
"virtual_key_hide",
"virtual_key_delete",
"virtual_key_show",
"draw_enable_drawevent",
"draw_enable_swf_aa",
"draw_set_swf_aa_level",
"draw_get_swf_aa_level",
"draw_texture_flush",
"draw_flush",
"gpu_set_blendenable",
"gpu_set_ztestenable",
"gpu_set_zfunc",
"gpu_set_zwriteenable",
"gpu_set_lightingenable",
"gpu_set_fog",
"gpu_set_cullmode",
"gpu_set_blendmode",
"gpu_set_blendmode_ext",
"gpu_set_blendmode_ext_sepalpha",
"gpu_set_colorwriteenable",
"gpu_set_colourwriteenable",
"gpu_set_alphatestenable",
"gpu_set_alphatestref",
"gpu_set_alphatestfunc",
"gpu_set_texfilter",
"gpu_set_texfilter_ext",
"gpu_set_texrepeat",
"gpu_set_texrepeat_ext",
"gpu_set_tex_filter",
"gpu_set_tex_filter_ext",
"gpu_set_tex_repeat",
"gpu_set_tex_repeat_ext",
"gpu_set_tex_mip_filter",
"gpu_set_tex_mip_filter_ext",
"gpu_set_tex_mip_bias",
"gpu_set_tex_mip_bias_ext",
"gpu_set_tex_min_mip",
"gpu_set_tex_min_mip_ext",
"gpu_set_tex_max_mip",
"gpu_set_tex_max_mip_ext",
"gpu_set_tex_max_aniso",
"gpu_set_tex_max_aniso_ext",
"gpu_set_tex_mip_enable",
"gpu_set_tex_mip_enable_ext",
"gpu_get_blendenable",
"gpu_get_ztestenable",
"gpu_get_zfunc",
"gpu_get_zwriteenable",
"gpu_get_lightingenable",
"gpu_get_fog",
"gpu_get_cullmode",
"gpu_get_blendmode",
"gpu_get_blendmode_ext",
"gpu_get_blendmode_ext_sepalpha",
"gpu_get_blendmode_src",
"gpu_get_blendmode_dest",
"gpu_get_blendmode_srcalpha",
"gpu_get_blendmode_destalpha",
"gpu_get_colorwriteenable",
"gpu_get_colourwriteenable",
"gpu_get_alphatestenable",
"gpu_get_alphatestref",
"gpu_get_alphatestfunc",
"gpu_get_texfilter",
"gpu_get_texfilter_ext",
"gpu_get_texrepeat",
"gpu_get_texrepeat_ext",
"gpu_get_tex_filter",
"gpu_get_tex_filter_ext",
"gpu_get_tex_repeat",
"gpu_get_tex_repeat_ext",
"gpu_get_tex_mip_filter",
"gpu_get_tex_mip_filter_ext",
"gpu_get_tex_mip_bias",
"gpu_get_tex_mip_bias_ext",
"gpu_get_tex_min_mip",
"gpu_get_tex_min_mip_ext",
"gpu_get_tex_max_mip",
"gpu_get_tex_max_mip_ext",
"gpu_get_tex_max_aniso",
"gpu_get_tex_max_aniso_ext",
"gpu_get_tex_mip_enable",
"gpu_get_tex_mip_enable_ext",
"gpu_push_state",
"gpu_pop_state",
"gpu_get_state",
"gpu_set_state",
"draw_light_define_ambient",
"draw_light_define_direction",
"draw_light_define_point",
"draw_light_enable",
"draw_set_lighting",
"draw_light_get_ambient",
"draw_light_get",
"draw_get_lighting",
"shop_leave_rating",
"url_get_domain",
"url_open",
"url_open_ext",
"url_open_full",
"get_timer",
"achievement_login",
"achievement_logout",
"achievement_post",
"achievement_increment",
"achievement_post_score",
"achievement_available",
"achievement_show_achievements",
"achievement_show_leaderboards",
"achievement_load_friends",
"achievement_load_leaderboard",
"achievement_send_challenge",
"achievement_load_progress",
"achievement_reset",
"achievement_login_status",
"achievement_get_pic",
"achievement_show_challenge_notifications",
"achievement_get_challenges",
"achievement_event",
"achievement_show",
"achievement_get_info",
"cloud_file_save",
"cloud_string_save",
"cloud_synchronise",
"ads_enable",
"ads_disable",
"ads_setup",
"ads_engagement_launch",
"ads_engagement_available",
"ads_engagement_active",
"ads_event",
"ads_event_preload",
"ads_set_reward_callback",
"ads_get_display_height",
"ads_get_display_width",
"ads_move",
"ads_interstitial_available",
"ads_interstitial_display",
"device_get_tilt_x",
"device_get_tilt_y",
"device_get_tilt_z",
"device_is_keypad_open",
"device_mouse_check_button",
"device_mouse_check_button_pressed",
"device_mouse_check_button_released",
"device_mouse_x",
"device_mouse_y",
"device_mouse_raw_x",
"device_mouse_raw_y",
"device_mouse_x_to_gui",
"device_mouse_y_to_gui",
"iap_activate",
"iap_status",
"iap_enumerate_products",
"iap_restore_all",
"iap_acquire",
"iap_consume",
"iap_product_details",
"iap_purchase_details",
"facebook_init",
"facebook_login",
"facebook_status",
"facebook_graph_request",
"facebook_dialog",
"facebook_logout",
"facebook_launch_offerwall",
"facebook_post_message",
"facebook_send_invite",
"facebook_user_id",
"facebook_accesstoken",
"facebook_check_permission",
"facebook_request_read_permissions",
"facebook_request_publish_permissions",
"gamepad_is_supported",
"gamepad_get_device_count",
"gamepad_is_connected",
"gamepad_get_description",
"gamepad_get_button_threshold",
"gamepad_set_button_threshold",
"gamepad_get_axis_deadzone",
"gamepad_set_axis_deadzone",
"gamepad_button_count",
"gamepad_button_check",
"gamepad_button_check_pressed",
"gamepad_button_check_released",
"gamepad_button_value",
"gamepad_axis_count",
"gamepad_axis_value",
"gamepad_set_vibration",
"gamepad_set_colour",
"gamepad_set_color",
"os_is_paused",
"window_has_focus",
"code_is_compiled",
"http_get",
"http_get_file",
"http_post_string",
"http_request",
"json_encode",
"json_decode",
"zip_unzip",
"load_csv",
"base64_encode",
"base64_decode",
"md5_string_unicode",
"md5_string_utf8",
"md5_file",
"os_is_network_connected",
"sha1_string_unicode",
"sha1_string_utf8",
"sha1_file",
"os_powersave_enable",
"analytics_event",
"analytics_event_ext",
"win8_livetile_tile_notification",
"win8_livetile_tile_clear",
"win8_livetile_badge_notification",
"win8_livetile_badge_clear",
"win8_livetile_queue_enable",
"win8_secondarytile_pin",
"win8_secondarytile_badge_notification",
"win8_secondarytile_delete",
"win8_livetile_notification_begin",
"win8_livetile_notification_secondary_begin",
"win8_livetile_notification_expiry",
"win8_livetile_notification_tag",
"win8_livetile_notification_text_add",
"win8_livetile_notification_image_add",
"win8_livetile_notification_end",
"win8_appbar_enable",
"win8_appbar_add_element",
"win8_appbar_remove_element",
"win8_settingscharm_add_entry",
"win8_settingscharm_add_html_entry",
"win8_settingscharm_add_xaml_entry",
"win8_settingscharm_set_xaml_property",
"win8_settingscharm_get_xaml_property",
"win8_settingscharm_remove_entry",
"win8_share_image",
"win8_share_screenshot",
"win8_share_file",
"win8_share_url",
"win8_share_text",
"win8_search_enable",
"win8_search_disable",
"win8_search_add_suggestions",
"win8_device_touchscreen_available",
"win8_license_initialize_sandbox",
"win8_license_trial_version",
"winphone_license_trial_version",
"winphone_tile_title",
"winphone_tile_count",
"winphone_tile_back_title",
"winphone_tile_back_content",
"winphone_tile_back_content_wide",
"winphone_tile_front_image",
"winphone_tile_front_image_small",
"winphone_tile_front_image_wide",
"winphone_tile_back_image",
"winphone_tile_back_image_wide",
"winphone_tile_background_colour",
"winphone_tile_background_color",
"winphone_tile_icon_image",
"winphone_tile_small_icon_image",
"winphone_tile_wide_content",
"winphone_tile_cycle_images",
"winphone_tile_small_background_image",
"physics_world_create",
"physics_world_gravity",
"physics_world_update_speed",
"physics_world_update_iterations",
"physics_world_draw_debug",
"physics_pause_enable",
"physics_fixture_create",
"physics_fixture_set_kinematic",
"physics_fixture_set_density",
"physics_fixture_set_awake",
"physics_fixture_set_restitution",
"physics_fixture_set_friction",
"physics_fixture_set_collision_group",
"physics_fixture_set_sensor",
"physics_fixture_set_linear_damping",
"physics_fixture_set_angular_damping",
"physics_fixture_set_circle_shape",
"physics_fixture_set_box_shape",
"physics_fixture_set_edge_shape",
"physics_fixture_set_polygon_shape",
"physics_fixture_set_chain_shape",
"physics_fixture_add_point",
"physics_fixture_bind",
"physics_fixture_bind_ext",
"physics_fixture_delete",
"physics_apply_force",
"physics_apply_impulse",
"physics_apply_angular_impulse",
"physics_apply_local_force",
"physics_apply_local_impulse",
"physics_apply_torque",
"physics_mass_properties",
"physics_draw_debug",
"physics_test_overlap",
"physics_remove_fixture",
"physics_set_friction",
"physics_set_density",
"physics_set_restitution",
"physics_get_friction",
"physics_get_density",
"physics_get_restitution",
"physics_joint_distance_create",
"physics_joint_rope_create",
"physics_joint_revolute_create",
"physics_joint_prismatic_create",
"physics_joint_pulley_create",
"physics_joint_wheel_create",
"physics_joint_weld_create",
"physics_joint_friction_create",
"physics_joint_gear_create",
"physics_joint_enable_motor",
"physics_joint_get_value",
"physics_joint_set_value",
"physics_joint_delete",
"physics_particle_create",
"physics_particle_delete",
"physics_particle_delete_region_circle",
"physics_particle_delete_region_box",
"physics_particle_delete_region_poly",
"physics_particle_set_flags",
"physics_particle_set_category_flags",
"physics_particle_draw",
"physics_particle_draw_ext",
"physics_particle_count",
"physics_particle_get_data",
"physics_particle_get_data_particle",
"physics_particle_group_begin",
"physics_particle_group_circle",
"physics_particle_group_box",
"physics_particle_group_polygon",
"physics_particle_group_add_point",
"physics_particle_group_end",
"physics_particle_group_join",
"physics_particle_group_delete",
"physics_particle_group_count",
"physics_particle_group_get_data",
"physics_particle_group_get_mass",
"physics_particle_group_get_inertia",
"physics_particle_group_get_centre_x",
"physics_particle_group_get_centre_y",
"physics_particle_group_get_vel_x",
"physics_particle_group_get_vel_y",
"physics_particle_group_get_ang_vel",
"physics_particle_group_get_x",
"physics_particle_group_get_y",
"physics_particle_group_get_angle",
"physics_particle_set_group_flags",
"physics_particle_get_group_flags",
"physics_particle_get_max_count",
"physics_particle_get_radius",
"physics_particle_get_density",
"physics_particle_get_damping",
"physics_particle_get_gravity_scale",
"physics_particle_set_max_count",
"physics_particle_set_radius",
"physics_particle_set_density",
"physics_particle_set_damping",
"physics_particle_set_gravity_scale",
"network_create_socket",
"network_create_socket_ext",
"network_create_server",
"network_create_server_raw",
"network_connect",
"network_connect_raw",
"network_send_packet",
"network_send_raw",
"network_send_broadcast",
"network_send_udp",
"network_send_udp_raw",
"network_set_timeout",
"network_set_config",
"network_resolve",
"network_destroy",
"buffer_create",
"buffer_write",
"buffer_read",
"buffer_seek",
"buffer_get_surface",
"buffer_set_surface",
"buffer_delete",
"buffer_exists",
"buffer_get_type",
"buffer_get_alignment",
"buffer_poke",
"buffer_peek",
"buffer_save",
"buffer_save_ext",
"buffer_load",
"buffer_load_ext",
"buffer_load_partial",
"buffer_copy",
"buffer_fill",
"buffer_get_size",
"buffer_tell",
"buffer_resize",
"buffer_md5",
"buffer_sha1",
"buffer_base64_encode",
"buffer_base64_decode",
"buffer_base64_decode_ext",
"buffer_sizeof",
"buffer_get_address",
"buffer_create_from_vertex_buffer",
"buffer_create_from_vertex_buffer_ext",
"buffer_copy_from_vertex_buffer",
"buffer_async_group_begin",
"buffer_async_group_option",
"buffer_async_group_end",
"buffer_load_async",
"buffer_save_async",
"gml_release_mode",
"gml_pragma",
"steam_activate_overlay",
"steam_is_overlay_enabled",
"steam_is_overlay_activated",
"steam_get_persona_name",
"steam_initialised",
"steam_is_cloud_enabled_for_app",
"steam_is_cloud_enabled_for_account",
"steam_file_persisted",
"steam_get_quota_total",
"steam_get_quota_free",
"steam_file_write",
"steam_file_write_file",
"steam_file_read",
"steam_file_delete",
"steam_file_exists",
"steam_file_size",
"steam_file_share",
"steam_is_screenshot_requested",
"steam_send_screenshot",
"steam_is_user_logged_on",
"steam_get_user_steam_id",
"steam_user_owns_dlc",
"steam_user_installed_dlc",
"steam_set_achievement",
"steam_get_achievement",
"steam_clear_achievement",
"steam_set_stat_int",
"steam_set_stat_float",
"steam_set_stat_avg_rate",
"steam_get_stat_int",
"steam_get_stat_float",
"steam_get_stat_avg_rate",
"steam_reset_all_stats",
"steam_reset_all_stats_achievements",
"steam_stats_ready",
"steam_create_leaderboard",
"steam_upload_score",
"steam_upload_score_ext",
"steam_download_scores_around_user",
"steam_download_scores",
"steam_download_friends_scores",
"steam_upload_score_buffer",
"steam_upload_score_buffer_ext",
"steam_current_game_language",
"steam_available_languages",
"steam_activate_overlay_browser",
"steam_activate_overlay_user",
"steam_activate_overlay_store",
"steam_get_user_persona_name",
"steam_get_app_id",
"steam_get_user_account_id",
"steam_ugc_download",
"steam_ugc_create_item",
"steam_ugc_start_item_update",
"steam_ugc_set_item_title",
"steam_ugc_set_item_description",
"steam_ugc_set_item_visibility",
"steam_ugc_set_item_tags",
"steam_ugc_set_item_content",
"steam_ugc_set_item_preview",
"steam_ugc_submit_item_update",
"steam_ugc_get_item_update_progress",
"steam_ugc_subscribe_item",
"steam_ugc_unsubscribe_item",
"steam_ugc_num_subscribed_items",
"steam_ugc_get_subscribed_items",
"steam_ugc_get_item_install_info",
"steam_ugc_get_item_update_info",
"steam_ugc_request_item_details",
"steam_ugc_create_query_user",
"steam_ugc_create_query_user_ex",
"steam_ugc_create_query_all",
"steam_ugc_create_query_all_ex",
"steam_ugc_query_set_cloud_filename_filter",
"steam_ugc_query_set_match_any_tag",
"steam_ugc_query_set_search_text",
"steam_ugc_query_set_ranked_by_trend_days",
"steam_ugc_query_add_required_tag",
"steam_ugc_query_add_excluded_tag",
"steam_ugc_query_set_return_long_description",
"steam_ugc_query_set_return_total_only",
"steam_ugc_query_set_allow_cached_response",
"steam_ugc_send_query",
"shader_set",
"shader_get_name",
"shader_reset",
"shader_current",
"shader_is_compiled",
"shader_get_sampler_index",
"shader_get_uniform",
"shader_set_uniform_i",
"shader_set_uniform_i_array",
"shader_set_uniform_f",
"shader_set_uniform_f_array",
"shader_set_uniform_matrix",
"shader_set_uniform_matrix_array",
"shader_enable_corner_id",
"texture_set_stage",
"texture_get_texel_width",
"texture_get_texel_height",
"shaders_are_supported",
"vertex_format_begin",
"vertex_format_end",
"vertex_format_delete",
"vertex_format_add_position",
"vertex_format_add_position_3d",
"vertex_format_add_colour",
"vertex_format_add_color",
"vertex_format_add_normal",
"vertex_format_add_texcoord",
"vertex_format_add_textcoord",
"vertex_format_add_custom",
"vertex_create_buffer",
"vertex_create_buffer_ext",
"vertex_delete_buffer",
"vertex_begin",
"vertex_end",
"vertex_position",
"vertex_position_3d",
"vertex_colour",
"vertex_color",
"vertex_argb",
"vertex_texcoord",
"vertex_normal",
"vertex_float1",
"vertex_float2",
"vertex_float3",
"vertex_float4",
"vertex_ubyte4",
"vertex_submit",
"vertex_freeze",
"vertex_get_number",
"vertex_get_buffer_size",
"vertex_create_buffer_from_buffer",
"vertex_create_buffer_from_buffer_ext",
"push_local_notification",
"push_get_first_local_notification",
"push_get_next_local_notification",
"push_cancel_local_notification",
"skeleton_animation_set",
"skeleton_animation_get",
"skeleton_animation_mix",
"skeleton_animation_set_ext",
"skeleton_animation_get_ext",
"skeleton_animation_get_duration",
"skeleton_animation_get_frames",
"skeleton_animation_clear",
"skeleton_skin_set",
"skeleton_skin_get",
"skeleton_attachment_set",
"skeleton_attachment_get",
"skeleton_attachment_create",
"skeleton_collision_draw_set",
"skeleton_bone_data_get",
"skeleton_bone_data_set",
"skeleton_bone_state_get",
"skeleton_bone_state_set",
"skeleton_get_minmax",
"skeleton_get_num_bounds",
"skeleton_get_bounds",
"skeleton_animation_get_frame",
"skeleton_animation_set_frame",
"draw_skeleton",
"draw_skeleton_time",
"draw_skeleton_instance",
"draw_skeleton_collision",
"skeleton_animation_list",
"skeleton_skin_list",
"skeleton_slot_data",
"layer_get_id",
"layer_get_id_at_depth",
"layer_get_depth",
"layer_create",
"layer_destroy",
"layer_destroy_instances",
"layer_add_instance",
"layer_has_instance",
"layer_set_visible",
"layer_get_visible",
"layer_exists",
"layer_x",
"layer_y",
"layer_get_x",
"layer_get_y",
"layer_hspeed",
"layer_vspeed",
"layer_get_hspeed",
"layer_get_vspeed",
"layer_script_begin",
"layer_script_end",
"layer_shader",
"layer_get_script_begin",
"layer_get_script_end",
"layer_get_shader",
"layer_set_target_room",
"layer_get_target_room",
"layer_reset_target_room",
"layer_get_all",
"layer_get_all_elements",
"layer_get_name",
"layer_depth",
"layer_get_element_layer",
"layer_get_element_type",
"layer_element_move",
"layer_force_draw_depth",
"layer_is_draw_depth_forced",
"layer_get_forced_depth",
"layer_background_get_id",
"layer_background_exists",
"layer_background_create",
"layer_background_destroy",
"layer_background_visible",
"layer_background_change",
"layer_background_sprite",
"layer_background_htiled",
"layer_background_vtiled",
"layer_background_stretch",
"layer_background_yscale",
"layer_background_xscale",
"layer_background_blend",
"layer_background_alpha",
"layer_background_index",
"layer_background_speed",
"layer_background_get_visible",
"layer_background_get_sprite",
"layer_background_get_htiled",
"layer_background_get_vtiled",
"layer_background_get_stretch",
"layer_background_get_yscale",
"layer_background_get_xscale",
"layer_background_get_blend",
"layer_background_get_alpha",
"layer_background_get_index",
"layer_background_get_speed",
"layer_sprite_get_id",
"layer_sprite_exists",
"layer_sprite_create",
"layer_sprite_destroy",
"layer_sprite_change",
"layer_sprite_index",
"layer_sprite_speed",
"layer_sprite_xscale",
"layer_sprite_yscale",
"layer_sprite_angle",
"layer_sprite_blend",
"layer_sprite_alpha",
"layer_sprite_x",
"layer_sprite_y",
"layer_sprite_get_sprite",
"layer_sprite_get_index",
"layer_sprite_get_speed",
"layer_sprite_get_xscale",
"layer_sprite_get_yscale",
"layer_sprite_get_angle",
"layer_sprite_get_blend",
"layer_sprite_get_alpha",
"layer_sprite_get_x",
"layer_sprite_get_y",
"layer_tilemap_get_id",
"layer_tilemap_exists",
"layer_tilemap_create",
"layer_tilemap_destroy",
"tilemap_tileset",
"tilemap_x",
"tilemap_y",
"tilemap_set",
"tilemap_set_at_pixel",
"tilemap_get_tileset",
"tilemap_get_tile_width",
"tilemap_get_tile_height",
"tilemap_get_width",
"tilemap_get_height",
"tilemap_get_x",
"tilemap_get_y",
"tilemap_get",
"tilemap_get_at_pixel",
"tilemap_get_cell_x_at_pixel",
"tilemap_get_cell_y_at_pixel",
"tilemap_clear",
"draw_tilemap",
"draw_tile",
"tilemap_set_global_mask",
"tilemap_get_global_mask",
"tilemap_set_mask",
"tilemap_get_mask",
"tilemap_get_frame",
"tile_set_empty",
"tile_set_index",
"tile_set_flip",
"tile_set_mirror",
"tile_set_rotate",
"tile_get_empty",
"tile_get_index",
"tile_get_flip",
"tile_get_mirror",
"tile_get_rotate",
"layer_tile_exists",
"layer_tile_create",
"layer_tile_destroy",
"layer_tile_change",
"layer_tile_xscale",
"layer_tile_yscale",
"layer_tile_blend",
"layer_tile_alpha",
"layer_tile_x",
"layer_tile_y",
"layer_tile_region",
"layer_tile_visible",
"layer_tile_get_sprite",
"layer_tile_get_xscale",
"layer_tile_get_yscale",
"layer_tile_get_blend",
"layer_tile_get_alpha",
"layer_tile_get_x",
"layer_tile_get_y",
"layer_tile_get_region",
"layer_tile_get_visible",
"layer_instance_get_instance",
"instance_activate_layer",
"instance_deactivate_layer",
"camera_create",
"camera_create_view",
"camera_destroy",
"camera_apply",
"camera_get_active",
"camera_get_default",
"camera_set_default",
"camera_set_view_mat",
"camera_set_proj_mat",
"camera_set_update_script",
"camera_set_begin_script",
"camera_set_end_script",
"camera_set_view_pos",
"camera_set_view_size",
"camera_set_view_speed",
"camera_set_view_border",
"camera_set_view_angle",
"camera_set_view_target",
"camera_get_view_mat",
"camera_get_proj_mat",
"camera_get_update_script",
"camera_get_begin_script",
"camera_get_end_script",
"camera_get_view_x",
"camera_get_view_y",
"camera_get_view_width",
"camera_get_view_height",
"camera_get_view_speed_x",
"camera_get_view_speed_y",
"camera_get_view_border_x",
"camera_get_view_border_y",
"camera_get_view_angle",
"camera_get_view_target",
"view_get_camera",
"view_get_visible",
"view_get_xport",
"view_get_yport",
"view_get_wport",
"view_get_hport",
"view_get_surface_id",
"view_set_camera",
"view_set_visible",
"view_set_xport",
"view_set_yport",
"view_set_wport",
"view_set_hport",
"view_set_surface_id",
"gesture_drag_time",
"gesture_drag_distance",
"gesture_flick_speed",
"gesture_double_tap_time",
"gesture_double_tap_distance",
"gesture_pinch_distance",
"gesture_pinch_angle_towards",
"gesture_pinch_angle_away",
"gesture_rotate_time",
"gesture_rotate_angle",
"gesture_tap_count",
"gesture_get_drag_time",
"gesture_get_drag_distance",
"gesture_get_flick_speed",
"gesture_get_double_tap_time",
"gesture_get_double_tap_distance",
"gesture_get_pinch_distance",
"gesture_get_pinch_angle_towards",
"gesture_get_pinch_angle_away",
"gesture_get_rotate_time",
"gesture_get_rotate_angle",
"gesture_get_tap_count",
"keyboard_virtual_show",
"keyboard_virtual_hide",
"keyboard_virtual_status",
"keyboard_virtual_height"
];
const LITERALS = [
"true",
"false",
"all",
"noone",
"undefined",
"pointer_invalid",
"pointer_null"
];
// many of these look like enumerables to me (see comments below)
const SYMBOLS = [
"other",
"global",
"local",
"path_action_stop",
"path_action_restart",
"path_action_continue",
"path_action_reverse",
"pi",
"GM_build_date",
"GM_version",
"GM_runtime_version",
"timezone_local",
"timezone_utc",
"gamespeed_fps",
"gamespeed_microseconds",
// for example ev_ are types of events
"ev_create",
"ev_destroy",
"ev_step",
"ev_alarm",
"ev_keyboard",
"ev_mouse",
"ev_collision",
"ev_other",
"ev_draw",
"ev_draw_begin",
"ev_draw_end",
"ev_draw_pre",
"ev_draw_post",
"ev_keypress",
"ev_keyrelease",
"ev_trigger",
"ev_left_button",
"ev_right_button",
"ev_middle_button",
"ev_no_button",
"ev_left_press",
"ev_right_press",
"ev_middle_press",
"ev_left_release",
"ev_right_release",
"ev_middle_release",
"ev_mouse_enter",
"ev_mouse_leave",
"ev_mouse_wheel_up",
"ev_mouse_wheel_down",
"ev_global_left_button",
"ev_global_right_button",
"ev_global_middle_button",
"ev_global_left_press",
"ev_global_right_press",
"ev_global_middle_press",
"ev_global_left_release",
"ev_global_right_release",
"ev_global_middle_release",
"ev_joystick1_left",
"ev_joystick1_right",
"ev_joystick1_up",
"ev_joystick1_down",
"ev_joystick1_button1",
"ev_joystick1_button2",
"ev_joystick1_button3",
"ev_joystick1_button4",
"ev_joystick1_button5",
"ev_joystick1_button6",
"ev_joystick1_button7",
"ev_joystick1_button8",
"ev_joystick2_left",
"ev_joystick2_right",
"ev_joystick2_up",
"ev_joystick2_down",
"ev_joystick2_button1",
"ev_joystick2_button2",
"ev_joystick2_button3",
"ev_joystick2_button4",
"ev_joystick2_button5",
"ev_joystick2_button6",
"ev_joystick2_button7",
"ev_joystick2_button8",
"ev_outside",
"ev_boundary",
"ev_game_start",
"ev_game_end",
"ev_room_start",
"ev_room_end",
"ev_no_more_lives",
"ev_animation_end",
"ev_end_of_path",
"ev_no_more_health",
"ev_close_button",
"ev_user0",
"ev_user1",
"ev_user2",
"ev_user3",
"ev_user4",
"ev_user5",
"ev_user6",
"ev_user7",
"ev_user8",
"ev_user9",
"ev_user10",
"ev_user11",
"ev_user12",
"ev_user13",
"ev_user14",
"ev_user15",
"ev_step_normal",
"ev_step_begin",
"ev_step_end",
"ev_gui",
"ev_gui_begin",
"ev_gui_end",
"ev_cleanup",
"ev_gesture",
"ev_gesture_tap",
"ev_gesture_double_tap",
"ev_gesture_drag_start",
"ev_gesture_dragging",
"ev_gesture_drag_end",
"ev_gesture_flick",
"ev_gesture_pinch_start",
"ev_gesture_pinch_in",
"ev_gesture_pinch_out",
"ev_gesture_pinch_end",
"ev_gesture_rotate_start",
"ev_gesture_rotating",
"ev_gesture_rotate_end",
"ev_global_gesture_tap",
"ev_global_gesture_double_tap",
"ev_global_gesture_drag_start",
"ev_global_gesture_dragging",
"ev_global_gesture_drag_end",
"ev_global_gesture_flick",
"ev_global_gesture_pinch_start",
"ev_global_gesture_pinch_in",
"ev_global_gesture_pinch_out",
"ev_global_gesture_pinch_end",
"ev_global_gesture_rotate_start",
"ev_global_gesture_rotating",
"ev_global_gesture_rotate_end",
"vk_nokey",
"vk_anykey",
"vk_enter",
"vk_return",
"vk_shift",
"vk_control",
"vk_alt",
"vk_escape",
"vk_space",
"vk_backspace",
"vk_tab",
"vk_pause",
"vk_printscreen",
"vk_left",
"vk_right",
"vk_up",
"vk_down",
"vk_home",
"vk_end",
"vk_delete",
"vk_insert",
"vk_pageup",
"vk_pagedown",
"vk_f1",
"vk_f2",
"vk_f3",
"vk_f4",
"vk_f5",
"vk_f6",
"vk_f7",
"vk_f8",
"vk_f9",
"vk_f10",
"vk_f11",
"vk_f12",
"vk_numpad0",
"vk_numpad1",
"vk_numpad2",
"vk_numpad3",
"vk_numpad4",
"vk_numpad5",
"vk_numpad6",
"vk_numpad7",
"vk_numpad8",
"vk_numpad9",
"vk_divide",
"vk_multiply",
"vk_subtract",
"vk_add",
"vk_decimal",
"vk_lshift",
"vk_lcontrol",
"vk_lalt",
"vk_rshift",
"vk_rcontrol",
"vk_ralt",
"mb_any",
"mb_none",
"mb_left",
"mb_right",
"mb_middle",
"c_aqua",
"c_black",
"c_blue",
"c_dkgray",
"c_fuchsia",
"c_gray",
"c_green",
"c_lime",
"c_ltgray",
"c_maroon",
"c_navy",
"c_olive",
"c_purple",
"c_red",
"c_silver",
"c_teal",
"c_white",
"c_yellow",
"c_orange",
"fa_left",
"fa_center",
"fa_right",
"fa_top",
"fa_middle",
"fa_bottom",
"pr_pointlist",
"pr_linelist",
"pr_linestrip",
"pr_trianglelist",
"pr_trianglestrip",
"pr_trianglefan",
"bm_complex",
"bm_normal",
"bm_add",
"bm_max",
"bm_subtract",
"bm_zero",
"bm_one",
"bm_src_colour",
"bm_inv_src_colour",
"bm_src_color",
"bm_inv_src_color",
"bm_src_alpha",
"bm_inv_src_alpha",
"bm_dest_alpha",
"bm_inv_dest_alpha",
"bm_dest_colour",
"bm_inv_dest_colour",
"bm_dest_color",
"bm_inv_dest_color",
"bm_src_alpha_sat",
"tf_point",
"tf_linear",
"tf_anisotropic",
"mip_off",
"mip_on",
"mip_markedonly",
"audio_falloff_none",
"audio_falloff_inverse_distance",
"audio_falloff_inverse_distance_clamped",
"audio_falloff_linear_distance",
"audio_falloff_linear_distance_clamped",
"audio_falloff_exponent_distance",
"audio_falloff_exponent_distance_clamped",
"audio_old_system",
"audio_new_system",
"audio_mono",
"audio_stereo",
"audio_3d",
"cr_default",
"cr_none",
"cr_arrow",
"cr_cross",
"cr_beam",
"cr_size_nesw",
"cr_size_ns",
"cr_size_nwse",
"cr_size_we",
"cr_uparrow",
"cr_hourglass",
"cr_drag",
"cr_appstart",
"cr_handpoint",
"cr_size_all",
"spritespeed_framespersecond",
"spritespeed_framespergameframe",
"asset_object",
"asset_unknown",
"asset_sprite",
"asset_sound",
"asset_room",
"asset_path",
"asset_script",
"asset_font",
"asset_timeline",
"asset_tiles",
"asset_shader",
"fa_readonly",
"fa_hidden",
"fa_sysfile",
"fa_volumeid",
"fa_directory",
"fa_archive",
"ds_type_map",
"ds_type_list",
"ds_type_stack",
"ds_type_queue",
"ds_type_grid",
"ds_type_priority",
"ef_explosion",
"ef_ring",
"ef_ellipse",
"ef_firework",
"ef_smoke",
"ef_smokeup",
"ef_star",
"ef_spark",
"ef_flare",
"ef_cloud",
"ef_rain",
"ef_snow",
"pt_shape_pixel",
"pt_shape_disk",
"pt_shape_square",
"pt_shape_line",
"pt_shape_star",
"pt_shape_circle",
"pt_shape_ring",
"pt_shape_sphere",
"pt_shape_flare",
"pt_shape_spark",
"pt_shape_explosion",
"pt_shape_cloud",
"pt_shape_smoke",
"pt_shape_snow",
"ps_distr_linear",
"ps_distr_gaussian",
"ps_distr_invgaussian",
"ps_shape_rectangle",
"ps_shape_ellipse",
"ps_shape_diamond",
"ps_shape_line",
"ty_real",
"ty_string",
"dll_cdecl",
"dll_stdcall",
"matrix_view",
"matrix_projection",
"matrix_world",
"os_win32",
"os_windows",
"os_macosx",
"os_ios",
"os_android",
"os_symbian",
"os_linux",
"os_unknown",
"os_winphone",
"os_tizen",
"os_win8native",
"os_wiiu",
"os_3ds",
"os_psvita",
"os_bb10",
"os_ps4",
"os_xboxone",
"os_ps3",
"os_xbox360",
"os_uwp",
"os_tvos",
"os_switch",
"browser_not_a_browser",
"browser_unknown",
"browser_ie",
"browser_firefox",
"browser_chrome",
"browser_safari",
"browser_safari_mobile",
"browser_opera",
"browser_tizen",
"browser_edge",
"browser_windows_store",
"browser_ie_mobile",
"device_ios_unknown",
"device_ios_iphone",
"device_ios_iphone_retina",
"device_ios_ipad",
"device_ios_ipad_retina",
"device_ios_iphone5",
"device_ios_iphone6",
"device_ios_iphone6plus",
"device_emulator",
"device_tablet",
"display_landscape",
"display_landscape_flipped",
"display_portrait",
"display_portrait_flipped",
"tm_sleep",
"tm_countvsyncs",
"of_challenge_win",
"of_challen",
"ge_lose",
"of_challenge_tie",
"leaderboard_type_number",
"leaderboard_type_time_mins_secs",
"cmpfunc_never",
"cmpfunc_less",
"cmpfunc_equal",
"cmpfunc_lessequal",
"cmpfunc_greater",
"cmpfunc_notequal",
"cmpfunc_greaterequal",
"cmpfunc_always",
"cull_noculling",
"cull_clockwise",
"cull_counterclockwise",
"lighttype_dir",
"lighttype_point",
"iap_ev_storeload",
"iap_ev_product",
"iap_ev_purchase",
"iap_ev_consume",
"iap_ev_restore",
"iap_storeload_ok",
"iap_storeload_failed",
"iap_status_uninitialised",
"iap_status_unavailable",
"iap_status_loading",
"iap_status_available",
"iap_status_processing",
"iap_status_restoring",
"iap_failed",
"iap_unavailable",
"iap_available",
"iap_purchased",
"iap_canceled",
"iap_refunded",
"fb_login_default",
"fb_login_fallback_to_webview",
"fb_login_no_fallback_to_webview",
"fb_login_forcing_webview",
"fb_login_use_system_account",
"fb_login_forcing_safari",
"phy_joint_anchor_1_x",
"phy_joint_anchor_1_y",
"phy_joint_anchor_2_x",
"phy_joint_anchor_2_y",
"phy_joint_reaction_force_x",
"phy_joint_reaction_force_y",
"phy_joint_reaction_torque",
"phy_joint_motor_speed",
"phy_joint_angle",
"phy_joint_motor_torque",
"phy_joint_max_motor_torque",
"phy_joint_translation",
"phy_joint_speed",
"phy_joint_motor_force",
"phy_joint_max_motor_force",
"phy_joint_length_1",
"phy_joint_length_2",
"phy_joint_damping_ratio",
"phy_joint_frequency",
"phy_joint_lower_angle_limit",
"phy_joint_upper_angle_limit",
"phy_joint_angle_limits",
"phy_joint_max_length",
"phy_joint_max_torque",
"phy_joint_max_force",
"phy_debug_render_aabb",
"phy_debug_render_collision_pairs",
"phy_debug_render_coms",
"phy_debug_render_core_shapes",
"phy_debug_render_joints",
"phy_debug_render_obb",
"phy_debug_render_shapes",
"phy_particle_flag_water",
"phy_particle_flag_zombie",
"phy_particle_flag_wall",
"phy_particle_flag_spring",
"phy_particle_flag_elastic",
"phy_particle_flag_viscous",
"phy_particle_flag_powder",
"phy_particle_flag_tensile",
"phy_particle_flag_colourmixing",
"phy_particle_flag_colormixing",
"phy_particle_group_flag_solid",
"phy_particle_group_flag_rigid",
"phy_particle_data_flag_typeflags",
"phy_particle_data_flag_position",
"phy_particle_data_flag_velocity",
"phy_particle_data_flag_colour",
"phy_particle_data_flag_color",
"phy_particle_data_flag_category",
"achievement_our_info",
"achievement_friends_info",
"achievement_leaderboard_info",
"achievement_achievement_info",
"achievement_filter_all_players",
"achievement_filter_friends_only",
"achievement_filter_favorites_only",
"achievement_type_achievement_challenge",
"achievement_type_score_challenge",
"achievement_pic_loaded",
"achievement_show_ui",
"achievement_show_profile",
"achievement_show_leaderboard",
"achievement_show_achievement",
"achievement_show_bank",
"achievement_show_friend_picker",
"achievement_show_purchase_prompt",
"network_socket_tcp",
"network_socket_udp",
"network_socket_bluetooth",
"network_type_connect",
"network_type_disconnect",
"network_type_data",
"network_type_non_blocking_connect",
"network_config_connect_timeout",
"network_config_use_non_blocking_socket",
"network_config_enable_reliable_udp",
"network_config_disable_reliable_udp",
"buffer_fixed",
"buffer_grow",
"buffer_wrap",
"buffer_fast",
"buffer_vbuffer",
"buffer_network",
"buffer_u8",
"buffer_s8",
"buffer_u16",
"buffer_s16",
"buffer_u32",
"buffer_s32",
"buffer_u64",
"buffer_f16",
"buffer_f32",
"buffer_f64",
"buffer_bool",
"buffer_text",
"buffer_string",
"buffer_surface_copy",
"buffer_seek_start",
"buffer_seek_relative",
"buffer_seek_end",
"buffer_generalerror",
"buffer_outofspace",
"buffer_outofbounds",
"buffer_invalidtype",
"text_type",
"button_type",
"input_type",
"ANSI_CHARSET",
"DEFAULT_CHARSET",
"EASTEUROPE_CHARSET",
"RUSSIAN_CHARSET",
"SYMBOL_CHARSET",
"SHIFTJIS_CHARSET",
"HANGEUL_CHARSET",
"GB2312_CHARSET",
"CHINESEBIG5_CHARSET",
"JOHAB_CHARSET",
"HEBREW_CHARSET",
"ARABIC_CHARSET",
"GREEK_CHARSET",
"TURKISH_CHARSET",
"VIETNAMESE_CHARSET",
"THAI_CHARSET",
"MAC_CHARSET",
"BALTIC_CHARSET",
"OEM_CHARSET",
"gp_face1",
"gp_face2",
"gp_face3",
"gp_face4",
"gp_shoulderl",
"gp_shoulderr",
"gp_shoulderlb",
"gp_shoulderrb",
"gp_select",
"gp_start",
"gp_stickl",
"gp_stickr",
"gp_padu",
"gp_padd",
"gp_padl",
"gp_padr",
"gp_axislh",
"gp_axislv",
"gp_axisrh",
"gp_axisrv",
"ov_friends",
"ov_community",
"ov_players",
"ov_settings",
"ov_gamegroup",
"ov_achievements",
"lb_sort_none",
"lb_sort_ascending",
"lb_sort_descending",
"lb_disp_none",
"lb_disp_numeric",
"lb_disp_time_sec",
"lb_disp_time_ms",
"ugc_result_success",
"ugc_filetype_community",
"ugc_filetype_microtrans",
"ugc_visibility_public",
"ugc_visibility_friends_only",
"ugc_visibility_private",
"ugc_query_RankedByVote",
"ugc_query_RankedByPublicationDate",
"ugc_query_AcceptedForGameRankedByAcceptanceDate",
"ugc_query_RankedByTrend",
"ugc_query_FavoritedByFriendsRankedByPublicationDate",
"ugc_query_CreatedByFriendsRankedByPublicationDate",
"ugc_query_RankedByNumTimesReported",
"ugc_query_CreatedByFollowedUsersRankedByPublicationDate",
"ugc_query_NotYetRated",
"ugc_query_RankedByTotalVotesAsc",
"ugc_query_RankedByVotesUp",
"ugc_query_RankedByTextSearch",
"ugc_sortorder_CreationOrderDesc",
"ugc_sortorder_CreationOrderAsc",
"ugc_sortorder_TitleAsc",
"ugc_sortorder_LastUpdatedDesc",
"ugc_sortorder_SubscriptionDateDesc",
"ugc_sortorder_VoteScoreDesc",
"ugc_sortorder_ForModeration",
"ugc_list_Published",
"ugc_list_VotedOn",
"ugc_list_VotedUp",
"ugc_list_VotedDown",
"ugc_list_WillVoteLater",
"ugc_list_Favorited",
"ugc_list_Subscribed",
"ugc_list_UsedOrPlayed",
"ugc_list_Followed",
"ugc_match_Items",
"ugc_match_Items_Mtx",
"ugc_match_Items_ReadyToUse",
"ugc_match_Collections",
"ugc_match_Artwork",
"ugc_match_Videos",
"ugc_match_Screenshots",
"ugc_match_AllGuides",
"ugc_match_WebGuides",
"ugc_match_IntegratedGuides",
"ugc_match_UsableInGame",
"ugc_match_ControllerBindings",
"vertex_usage_position",
"vertex_usage_colour",
"vertex_usage_color",
"vertex_usage_normal",
"vertex_usage_texcoord",
"vertex_usage_textcoord",
"vertex_usage_blendweight",
"vertex_usage_blendindices",
"vertex_usage_psize",
"vertex_usage_tangent",
"vertex_usage_binormal",
"vertex_usage_fog",
"vertex_usage_depth",
"vertex_usage_sample",
"vertex_type_float1",
"vertex_type_float2",
"vertex_type_float3",
"vertex_type_float4",
"vertex_type_colour",
"vertex_type_color",
"vertex_type_ubyte4",
"layerelementtype_undefined",
"layerelementtype_background",
"layerelementtype_instance",
"layerelementtype_oldtilemap",
"layerelementtype_sprite",
"layerelementtype_tilemap",
"layerelementtype_particlesystem",
"layerelementtype_tile",
"tile_rotate",
"tile_flip",
"tile_mirror",
"tile_index_mask",
"kbv_type_default",
"kbv_type_ascii",
"kbv_type_url",
"kbv_type_email",
"kbv_type_numbers",
"kbv_type_phone",
"kbv_type_phone_name",
"kbv_returnkey_default",
"kbv_returnkey_go",
"kbv_returnkey_google",
"kbv_returnkey_join",
"kbv_returnkey_next",
"kbv_returnkey_route",
"kbv_returnkey_search",
"kbv_returnkey_send",
"kbv_returnkey_yahoo",
"kbv_returnkey_done",
"kbv_returnkey_continue",
"kbv_returnkey_emergency",
"kbv_autocapitalize_none",
"kbv_autocapitalize_words",
"kbv_autocapitalize_sentences",
"kbv_autocapitalize_characters"
];
const LANGUAGE_VARIABLES = [
"self",
"argument_relative",
"argument",
"argument0",
"argument1",
"argument2",
"argument3",
"argument4",
"argument5",
"argument6",
"argument7",
"argument8",
"argument9",
"argument10",
"argument11",
"argument12",
"argument13",
"argument14",
"argument15",
"argument_count",
"x|0",
"y|0",
"xprevious",
"yprevious",
"xstart",
"ystart",
"hspeed",
"vspeed",
"direction",
"speed",
"friction",
"gravity",
"gravity_direction",
"path_index",
"path_position",
"path_positionprevious",
"path_speed",
"path_scale",
"path_orientation",
"path_endaction",
"object_index",
"id|0",
"solid",
"persistent",
"mask_index",
"instance_count",
"instance_id",
"room_speed",
"fps",
"fps_real",
"current_time",
"current_year",
"current_month",
"current_day",
"current_weekday",
"current_hour",
"current_minute",
"current_second",
"alarm",
"timeline_index",
"timeline_position",
"timeline_speed",
"timeline_running",
"timeline_loop",
"room",
"room_first",
"room_last",
"room_width",
"room_height",
"room_caption",
"room_persistent",
"score",
"lives",
"health",
"show_score",
"show_lives",
"show_health",
"caption_score",
"caption_lives",
"caption_health",
"event_type",
"event_number",
"event_object",
"event_action",
"application_surface",
"gamemaker_pro",
"gamemaker_registered",
"gamemaker_version",
"error_occurred",
"error_last",
"debug_mode",
"keyboard_key",
"keyboard_lastkey",
"keyboard_lastchar",
"keyboard_string",
"mouse_x",
"mouse_y",
"mouse_button",
"mouse_lastbutton",
"cursor_sprite",
"visible",
"sprite_index",
"sprite_width",
"sprite_height",
"sprite_xoffset",
"sprite_yoffset",
"image_number",
"image_index",
"image_speed",
"depth",
"image_xscale",
"image_yscale",
"image_angle",
"image_alpha",
"image_blend",
"bbox_left",
"bbox_right",
"bbox_top",
"bbox_bottom",
"layer",
"background_colour",
"background_showcolour",
"background_color",
"background_showcolor",
"view_enabled",
"view_current",
"view_visible",
"view_xview",
"view_yview",
"view_wview",
"view_hview",
"view_xport",
"view_yport",
"view_wport",
"view_hport",
"view_angle",
"view_hborder",
"view_vborder",
"view_hspeed",
"view_vspeed",
"view_object",
"view_surface_id",
"view_camera",
"game_id",
"game_display_name",
"game_project_name",
"game_save_id",
"working_directory",
"temp_directory",
"program_directory",
"browser_width",
"browser_height",
"os_type",
"os_device",
"os_browser",
"os_version",
"display_aa",
"async_load",
"delta_time",
"webgl_enabled",
"event_data",
"iap_data",
"phy_rotation",
"phy_position_x",
"phy_position_y",
"phy_angular_velocity",
"phy_linear_velocity_x",
"phy_linear_velocity_y",
"phy_speed_x",
"phy_speed_y",
"phy_speed",
"phy_angular_damping",
"phy_linear_damping",
"phy_bullet",
"phy_fixed_rotation",
"phy_active",
"phy_mass",
"phy_inertia",
"phy_com_x",
"phy_com_y",
"phy_dynamic",
"phy_kinematic",
"phy_sleeping",
"phy_collision_points",
"phy_collision_x",
"phy_collision_y",
"phy_col_normal_x",
"phy_col_normal_y",
"phy_position_xprevious",
"phy_position_yprevious"
];
return {
name: 'GML',
case_insensitive: false, // language is case-insensitive
keywords: {
keyword: KEYWORDS,
built_in: BUILT_INS,
literal: LITERALS,
symbol: SYMBOLS,
"variable.language": LANGUAGE_VARIABLES
},
contains: [
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE,
hljs.C_NUMBER_MODE
]
};
}
module.exports = gml;
/***/ }),
/***/ "./node_modules/highlight.js/lib/languages/go.js":
/*!*******************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/go.js ***!
\*******************************************************/
/***/ ((module) => {
/*
Language: Go
Author: Stephan Kountso aka StepLg