From a2458614df8875a68d63ee24c1b3079fe878a32a Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 18 Feb 2022 15:12:52 -0500 Subject: [PATCH] Don't include date line when generating filename for annotations note Since in many locales it would contain slashes and colons, both of which would be stripped in the filename, leaving long strings of numbers in the filename --- chrome/content/zotero/fileInterface.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/fileInterface.js b/chrome/content/zotero/fileInterface.js index b3ef0cde39..8f8128c384 100644 --- a/chrome/content/zotero/fileInterface.js +++ b/chrome/content/zotero/fileInterface.js @@ -81,7 +81,12 @@ Zotero_File_Exporter.prototype.save = async function () { } if (this.items.length == 1) { - let noteTitle = Zotero.Utilities.Item.noteToTitle(this.items[0].getNote()); + let noteTitle = Zotero.Utilities.Item.noteToTitle( + this.items[0].getNote(), + // Stop at
to exclude date from annotation notes, which won't be a valid + // filename in many locales + { stopAtLineBreak: true } + ); if (noteTitle) { this.name = Zotero.File.getValidFileName(noteTitle); }