prism-code-editor
Version:
Lightweight, extensible code editor component for the web using Prism
35 lines (34 loc) • 1.08 kB
JavaScript
import { l as languages } from "../../index-DF54SWhA.js";
import { b as braces } from "../../jsx-shared-zvCB3My3.js";
import { a as astroTag, b as addInlined } from "../../markup-shared-CV_3fTVY.js";
import { e as entity, x as xmlComment } from "../../xml-shared-D-sSvkQn.js";
var expression = {
pattern: RegExp(braces, "g"),
alias: "language-tsx",
inside: "tsx"
};
var tag = astroTag(expression);
var tagInside = tag.inside;
languages.astro = {
"comment": xmlComment,
"front-matter-block": {
pattern: /^---(?!.)[^]*?\n---/g,
inside: {
"punctuation": /^---|---$/,
"language-typescript": {
pattern: /[^]+/,
inside: "ts"
}
}
},
"script": addInlined("script", tagInside, (code) => {
return /^[^>]+?[\s"'}]is:inline\b/.test(code) ? "javascript" : "typescript";
}),
"style": addInlined("style", tagInside, (code) => {
return /^[^>]+?[\s"'}]lang\s*=\s*(["']?)(less|s[ac]ss|stylus)\b\1/.exec(code)?.[2] || "css";
}),
"expression": expression,
"tag": tag,
"entity": entity
};
//# sourceMappingURL=astro.js.map