From f656c2caaa150ee93414cdcabde825e43c70c8de Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Tue, 28 Oct 2025 21:32:05 +0200 Subject: [PATCH] fix(export/zip): links breaking down in markdown export --- apps/server/src/services/export/zip/markdown.ts | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/apps/server/src/services/export/zip/markdown.ts b/apps/server/src/services/export/zip/markdown.ts index 827f059d6..c876a5c16 100644 --- a/apps/server/src/services/export/zip/markdown.ts +++ b/apps/server/src/services/export/zip/markdown.ts @@ -8,18 +8,16 @@ export default class MarkdownExportProvider extends ZipExportProvider { prepareContent(title: string, content: string | Buffer, noteMeta: NoteMeta): string | Buffer { if (noteMeta.format === "markdown" && typeof content === "string") { - let markdownContent = mdService.toMarkdown(content); + content = this.rewriteFn(content, noteMeta); + content = mdService.toMarkdown(content); - if (markdownContent.trim().length > 0 && !markdownContent.startsWith("# ")) { - markdownContent = `# ${title}\r -${markdownContent}`; + if (content.trim().length > 0 && !content.startsWith("# ")) { + content = `\ +# ${title}\r +${content}`; } - - markdownContent = this.rewriteFn(markdownContent, noteMeta); - return markdownContent; - } else { - return content; } + return content; } afterDone() { }