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
This commit is contained in:
Dan Stillman 2022-02-18 15:12:52 -05:00
parent 5eee488e20
commit a2458614df

View file

@ -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 <br/> 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);
}