pull/774/head
Zef Hemel 2024-03-02 13:09:05 +01:00
parent c65173ec03
commit c584bbeb0a
1 changed files with 2 additions and 1 deletions

View File

@ -39,7 +39,8 @@ function preprocess(t: ParseTree, options: MarkdownRenderOptions = {}) {
if (!node.type) {
if (node.text?.startsWith("\n")) {
const prevNodeIdx = node.parent!.children!.indexOf(node) - 1;
if (node.parent!.children![prevNodeIdx]?.type !== "Paragraph") {
const prevNodeType = node.parent!.children![prevNodeIdx]?.type;
if (prevNodeType?.includes("Heading")) {
node.text = node.text.slice(1);
}
}