${escapeHtml(title)}${end}`;
}
function iconSvg(name) {
const paths = {
rocket: `
`,
sparkles: `
`,
"layout-dashboard": `
`,
terminal: `
`,
settings: `
`,
book: `
`,
globe: `
`,
wrench: `
`,
gear: `
`
};
const path = paths[slug(name)] ?? `
`;
return `
`;
}
function dedentComponentChildren(markdown) {
let depth = 0;
return markdown
.split("\n")
.map((line) => {
const markerMatch = line.match(new RegExp(`^${markerPrefix}:([^:]+):`));
if (markerMatch) {
if (markerMatch[1].endsWith("Close") || markerMatch[1] === "blockClose" || markerMatch[1] === "calloutClose") {
depth = Math.max(0, depth - 1);
}
const markerLine = line;
if (markerMatch[1].endsWith("Open") || markerMatch[1] === "blockOpen" || markerMatch[1] === "calloutOpen") {
depth += 1;
}
return markerLine;
}
if (depth <= 0 || !line.startsWith(" ")) return line;
return line.replace(new RegExp(`^ {1,${depth * 2}}`), "");
})
.join("\n");
}
function parseAttrs(raw) {
const attrs = {};
for (const match of raw.matchAll(/([A-Za-z0-9_-]+)(?:=(?:"([^"]*)"|'([^']*)'|\{([^}]*)\}|([^\s>]+)))?/g)) {
attrs[match[1]] = match[2] ?? match[3] ?? match[4] ?? match[5] ?? "";
}
return attrs;
}
function slug(value) {
return String(value).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
}
function escapeHtml(value) {
return String(value)
.replaceAll("&", "&")
.replaceAll("<", "<")
.replaceAll(">", ">")
.replaceAll('"', """);
}
function escapeAttr(value) {
return escapeHtml(value).replaceAll("'", "'");
}