//#region ../../node_modules/.pnpm/mdbox@0.1.1/node_modules/mdbox/dist/index.mjs
function heading(text, level) {
	if (!level || level < 1) level = 1;
	else if (level > 6) level = 6;
	return `
${"#".repeat(level)} ${text}
`;
}
function link(url, text, opts) {
	if (opts?.external) return `<a href="${url instanceof URL ? url.href : url}" title="${opts?.title ?? ""}" target="_blank">${text}</a>`;
	return `[${text || url}](${url || "#"}${opts?.title ? ` "${opts.title}"` : ""})`;
}
function image(url, text, opts) {
	return `![${text || ""}](${url || "#"}${opts?.title ? ` "${opts.title}"` : ""})`;
}
function codeBlock(code, lang, opts) {
	return `\`\`\`${lang || ""}${opts?.ext ? ` ${opts.ext}` : ""}
${code}
\`\`\``;
}
function table(table2) {
	return `${`| ${table2.columns.join(" | ")} |`}
${`| ${table2.columns.map(() => "---").join(" | ")} |`}
${table2.rows.map((row) => `| ${row.join(" | ")} |`).join("\n")}`;
}
function bold(text) {
	return `**${text}**`;
}
function italic(text) {
	return `_${text}_`;
}
function boldAndItalic(text) {
	return `***${text}***`;
}
function blockquote(text) {
	return text.split("\n").map((line) => `> ${line}`).join("\n");
}
function strikethrough(text) {
	return `~~${text}~~`;
}
function hr(length) {
	return "-".repeat(length || 3);
}
function list(items, opts = {}) {
	return items.map((item, index) => `${opts.ordered ? `${index + 1}.` : opts.char || "-"} ${item}`).join("\n");
}
const render = {
	__proto__: null,
	blockquote,
	bold,
	boldAndItalic,
	codeBlock,
	heading,
	hr,
	image,
	italic,
	link,
	list,
	strikethrough,
	table
};

//#endregion
export { image, link, render };
//# sourceMappingURL=index.mjs.map