ant-design-x-vue-next
Version:
Ant Design X for Vue — community continuation aligned with @ant-design/x
119 lines (118 loc) • 2.14 kB
JavaScript
import { r as a } from "../chunks/module-chunk.mjs";
const o = {
js: "javascript",
ts: "typescript",
html: "markup",
xml: "markup",
svg: "markup",
py: "python",
md: "markdown",
yml: "yaml",
sh: "bash",
shell: "bash"
}, l = {
clike: [],
markup: [],
css: [],
javascript: ["clike"],
typescript: ["javascript"],
jsx: ["markup", "javascript"],
tsx: ["jsx", "typescript"],
json: ["javascript"],
bash: [],
python: [],
markdown: ["markup"],
yaml: [],
java: ["clike"],
go: ["clike"],
rust: [],
sql: [],
less: ["css"],
scss: ["css"],
c: ["clike"],
cpp: ["c"],
csharp: ["clike"],
php: ["markup", "markup-templating"],
"markup-templating": ["markup"],
ruby: [],
swift: [],
kotlin: ["clike"],
objectivec: ["c"],
graphql: [],
diff: [],
docker: [],
nginx: []
}, m = [
"markup",
"css",
"clike",
"javascript",
"typescript",
"jsx",
"tsx",
"json",
"bash",
"python",
"markdown",
"yaml",
"java",
"go",
"rust",
"sql",
"less",
"scss"
], i = /* @__PURE__ */ new Map();
let c = null;
function u(s) {
return o[s] || s;
}
async function n(s) {
if (a.languages[s])
return;
const r = i.get(s);
if (r)
return r;
const t = (async () => {
const p = l[s] || [];
for (const e of p)
await n(e);
if (!a.languages[s])
try {
await import(
/* @vite-ignore */
`prismjs/components/prism-${s}.js`
);
} catch (e) {
console.warn(`[CodeHighlighter] Failed to load language: ${s}`, e);
}
})();
i.set(s, t);
try {
await t;
} finally {
}
}
async function g(s) {
const r = u(s);
return await n(r), r;
}
async function y() {
return c || (c = Promise.all(m.map((s) => g(s))).then(
() => {
}
)), c;
}
function h(s) {
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
}
function f(s, r) {
const t = a.languages[r];
return t ? a.highlight(s, t, r) : h(s);
}
export {
a as Prism,
y as ensureFullPrism,
g as ensureLanguage,
h as escapeHtml,
f as highlightCode
};