mirror of
https://github.com/zadam/trilium.git
synced 2025-10-31 19:49:01 +01:00
fix(export/zip): links breaking down in markdown export
This commit is contained in:
parent
bd3e92f091
commit
f656c2caaa
@ -8,18 +8,16 @@ export default class MarkdownExportProvider extends ZipExportProvider {
|
|||||||
|
|
||||||
prepareContent(title: string, content: string | Buffer, noteMeta: NoteMeta): string | Buffer {
|
prepareContent(title: string, content: string | Buffer, noteMeta: NoteMeta): string | Buffer {
|
||||||
if (noteMeta.format === "markdown" && typeof content === "string") {
|
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("# ")) {
|
if (content.trim().length > 0 && !content.startsWith("# ")) {
|
||||||
markdownContent = `# ${title}\r
|
content = `\
|
||||||
${markdownContent}`;
|
# ${title}\r
|
||||||
|
${content}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
markdownContent = this.rewriteFn(markdownContent, noteMeta);
|
|
||||||
return markdownContent;
|
|
||||||
} else {
|
|
||||||
return content;
|
|
||||||
}
|
}
|
||||||
|
return content;
|
||||||
}
|
}
|
||||||
|
|
||||||
afterDone() { }
|
afterDone() { }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user