fix: use :tablesep: for table items and end code blocks with newline
This commit is contained in:
parent
0727c5ebec
commit
9cd8ccd4e2
1 changed files with 3 additions and 3 deletions
|
|
@ -51,7 +51,7 @@ export async function renderMarkdown(
|
||||||
} catch {}
|
} catch {}
|
||||||
}
|
}
|
||||||
|
|
||||||
return `\`\`\`${chalk.green(meta?.language)}\n${toRender}\n\`\`\``;
|
return `\`\`\`${chalk.green(meta?.language)}\n${toRender}\n\`\`\`\n`;
|
||||||
},
|
},
|
||||||
list: (children, { depth }) =>
|
list: (children, { depth }) =>
|
||||||
`${depth > 0 ? "\n" : ""}${children}${depth === 0 ? "\n" : ""}`,
|
`${depth > 0 ? "\n" : ""}${children}${depth === 0 ? "\n" : ""}`,
|
||||||
|
|
@ -75,10 +75,10 @@ export async function renderMarkdown(
|
||||||
return `${toRender}\n\n`;
|
return `${toRender}\n\n`;
|
||||||
},
|
},
|
||||||
tr: (children) => {
|
tr: (children) => {
|
||||||
if (children) currentTable.push(children.split("|").slice(1));
|
if (children) currentTable.push(children.split(":tablesep:").slice(1));
|
||||||
return "";
|
return "";
|
||||||
},
|
},
|
||||||
td: (children) => `|${children}`,
|
td: (children) => `:tablesep:${children}`,
|
||||||
th: (children) => {
|
th: (children) => {
|
||||||
currentTable.options.head.push(children);
|
currentTable.options.head.push(children);
|
||||||
return "";
|
return "";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue