fix: use :tablesep: for table items and end code blocks with newline

This commit is contained in:
mitchell 2026-04-19 17:51:23 -04:00
parent 0727c5ebec
commit 9cd8ccd4e2

View file

@ -51,7 +51,7 @@ export async function renderMarkdown(
} catch {}
}
return `\`\`\`${chalk.green(meta?.language)}\n${toRender}\n\`\`\``;
return `\`\`\`${chalk.green(meta?.language)}\n${toRender}\n\`\`\`\n`;
},
list: (children, { depth }) =>
`${depth > 0 ? "\n" : ""}${children}${depth === 0 ? "\n" : ""}`,
@ -75,10 +75,10 @@ export async function renderMarkdown(
return `${toRender}\n\n`;
},
tr: (children) => {
if (children) currentTable.push(children.split("|").slice(1));
if (children) currentTable.push(children.split(":tablesep:").slice(1));
return "";
},
td: (children) => `|${children}`,
td: (children) => `:tablesep:${children}`,
th: (children) => {
currentTable.options.head.push(children);
return "";