UNPKG

prism-code-editor

Version:

Lightweight, extensible code editor component for the web using Prism

37 lines (36 loc) 1.11 kB
import { l as languages } from "../../index-C1_GGQ8y.js"; import { b as braces } from "../../jsx-shared-Dd7t2otl.js"; import { a as astroTag, b as addInlined } from "../../markup-shared-D_TTcCGm.js"; import { e as entity, x as xmlComment } from "../../xml-shared-D4vCmq1i.js"; var expression = { pattern: RegExp(braces, "g"), greedy: true, alias: "language-tsx", inside: "tsx" }; var tag = astroTag(expression); var tagInside = tag.inside; languages.astro = { "comment": xmlComment, "front-matter-block": { pattern: /^---(?!.)[^]*?\n---/g, greedy: true, 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)\1/.exec(code)?.[2] || "css"; }), "expression": expression, "tag": tag, "entity": entity }; //# sourceMappingURL=astro.js.map