add download extension in settings

This commit is contained in:
quenousimporte 2024-03-12 10:32:21 +01:00
parent 893b23a985
commit 83a662a09e
1 changed files with 5 additions and 4 deletions

View File

@ -14,7 +14,8 @@ var defaultsettings =
password: "",
sync: false,
tagsinlists: true,
uselinkpopup: true
uselinkpopup: true,
downloadextension: ".md"
};
//builtin
@ -974,7 +975,7 @@ function sharehtml()
function getfilename(title)
{
return title.replace(/[\?\"<>|\*:\/\\]/g, "_");
return title.replace(/[\?\"<>|\*:\/\\]/g, "_") + settings.downloadextension;
}
function download(filename, content)
@ -1093,13 +1094,13 @@ function downloadnotewithsubs()
var note = withsubs();
if (note)
{
download(note.title + ".md", note.content);
download(getfilename(note.title), note.content);
}
}
function downloadnote()
{
download(title.value + ".md", md.value);
download(getfilename(title.value), md.value);
}
function getguid(title)