prism-code-editor
Version:
Lightweight, extensible code editor component for the web using Prism
65 lines (64 loc) • 1.78 kB
JavaScript
import { l as languages, r as rest } from "../../index-DF54SWhA.js";
import { c as clone, i as insertBefore } from "../../language-BqHrf6z-.js";
import { b as boolean } from "../../patterns-Jkz_nwNQ.js";
import "./markup.js";
var vel = languages.velocity = clone(languages.html);
var string = /"[^"]*"|'[^']*'/g;
var punctuation = /[()[\]{}.,:]/;
var number = /\b\d+\b/;
var variable = {
pattern: /(^|[^\\](?:\\\\)*)\$!?(?:[a-z][\w-]*(?:\([^)]*\))?(?:\.[a-z][\w-]*(?:\([^)]*\))?|\[[^\]]+\])*|\{[^}]+\})/i,
lookbehind: true,
inside: {
"string": string,
"function": {
pattern: /([^\w-])[a-z][\w-]*(?=\()/,
lookbehind: true
},
"number": number,
"boolean": boolean,
"punctuation": punctuation
}
};
insertBefore(vel, "comment", {
"unparsed": {
pattern: /(^|[^\\])#\[\[[^]*?\]\]#/g,
lookbehind: true,
inside: {
"punctuation": /^...|\]\]#$/g
}
},
"velocity-comment": [
{
pattern: /(^|[^\\])#\*[^]*?\*#/g,
lookbehind: true,
alias: "comment"
},
{
pattern: /(^|[^\\])##.*/g,
lookbehind: true,
alias: "comment"
}
],
"directive": {
pattern: /(^|[^\\](?:\\\\)*)#@?(?:[a-z][\w-]*|\{[a-z][\w-]*\})(?:\s*\((?:[^()]|\([^)]*\))*\))?/i,
lookbehind: true,
inside: {
"keyword": {
pattern: /^#@?(?:[a-z][\w-]*|\{[a-z][\w-]*\})|\bin\b/,
inside: {
"punctuation": /[{}]/
}
},
"variable": variable,
"string": string,
"number": number,
"boolean": boolean,
"operator": /[!=<>]=?|[%/*+-]|&&|\|\||\.\.|\b(?:eq|[gl][et]|ne|not)\b/,
"punctuation": punctuation
}
},
"variable": variable
});
vel["tag"].inside["attr-value"][2].inside[rest] = vel;
//# sourceMappingURL=velocity.js.map