Skip to content

Build your personal knowledge base with Trilium Notes

fix(export/markdown): type error due to blankReplacement signature change

Elian Doranbfb6d975ff01
diff --git a/apps/server/src/services/export/markdown.ts b/apps/server/src/services/export/markdown.ts
index 0d7a8deb4f..93adb594e0 100644
--- a/apps/server/src/services/export/markdown.ts
+++ b/apps/server/src/services/export/markdown.ts
@@ -37,14 +37,14 @@ function toMarkdown(content: string) {
headingStyle: "atx",
bulletListMarker: "*",
codeBlockStyle: "fenced",
- blankReplacement(content, node, options) {
- if (node.nodeName === "SECTION" && (node as HTMLElement).classList.contains("include-note")) {
- return (node as HTMLElement).outerHTML;
+ blankReplacement(_content, node) {
+ if (node.nodeName === "SECTION" && node.classList.contains("include-note")) {
+ return node.outerHTML;
}
// Original implementation as per https://github.com/mixmark-io/turndown/blob/master/src/turndown.js.
return ("isBlock" in node && node.isBlock) ? '\n\n' : '';
- }
+ },
});
// Filter is heavily based on: https://github.com/mixmark-io/turndown/issues/274#issuecomment-458730974
instance.addRule("fencedCodeBlock", fencedCodeBlockFilter);