Set default filename when exporting single note (#2339)

This commit is contained in:
Abe Jellinek 2022-02-08 20:28:53 -08:00 committed by GitHub
parent 734057ff9b
commit 9cf45c0a0b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -79,6 +79,13 @@ Zotero_File_Exporter.prototype.save = async function () {
if (htmlTranslator) {
htmlTranslator.label = 'HTML';
}
if (this.items.length == 1) {
let noteTitle = Zotero.Utilities.Item.noteToTitle(this.items[0].getNote());
if (noteTitle) {
this.name = Zotero.File.getValidFileName(noteTitle);
}
}
}
// Otherwise exclude note export translators
else {