UNPKG

prism-code-editor

Version:

Lightweight, extensible code editor component for the web using Prism

37 lines (36 loc) 1.09 kB
import { a as languages } from "../../core-8vQkh0Rd.js"; import { n as braces } from "../../jsx-shared-DIcqKxFi.js"; import { r as xmlComment, t as entity } from "../../xml-shared-BvyhLOaL.js"; import { n as astroTag, t as addInlined } from "../../markup-shared-YW12LkHC.js"; //#region src/prism/languages/astro.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 }; //#endregion //# sourceMappingURL=astro.js.map