Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: sanitize filename for single note export

Abdullah Atta7e4ab8e14b58
diff --git a/apps/web/src/common/export.ts b/apps/web/src/common/export.ts
index aae65ffcf..e50bf3d50 100644
--- a/apps/web/src/common/export.ts
+++ b/apps/web/src/common/export.ts
@@ -22,6 +22,7 @@ import { TaskManager } from "./task-manager";
import { zip } from "../utils/zip";
import { saveAs } from "file-saver";
import { showToast } from "../utils/toast";
+import { sanitizeFilename } from "../utils/filename";
export async function exportToPDF(
title: string,
@@ -83,7 +84,7 @@ export async function exportNotes(
if (files.length === 1) {
saveAs(
new Blob([Buffer.from(files[0].content, "utf-8")]),
- `${files[0].filename}.${format}`
+ `${sanitizeFilename(files[0].filename)}.${format}`
);
} else {
const zipped = await zip(files, format);