update: export markdown to relative path

This commit is contained in:
xiangyu 2022-06-01 23:50:04 +08:00
parent d37d665317
commit 3048b1b933
3 changed files with 6 additions and 12 deletions

View File

@ -1707,11 +1707,11 @@ let bundle;
`${_Zotero.Knowledge4Zotero.knowledge._exportPath}\\${imgKey}.${ext}`
);
Zotero.debug(newFile.path);
const newFilePath = `attachments\\${newFile.path
.split("\\")
.pop()}`;
img.setAttribute(
"src",
_Zotero.isMac ? "file://" + newFile.path : newFile.path
);
img.setAttribute("src", newFilePath);
img.setAttribute("alt", "image");
}

View File

@ -18,7 +18,7 @@ configs[TRANSLATOR_ID_BETTER_MARKDOWN] = {
},
inRepository: true,
translatorType: 2,
lastUpdated: "2022-06-01 10:26:46",
lastUpdated: "2022-06-01 23:26:46",
_codePath:
"chrome://Knowledge4Zotero/content/translators/Better Note Markdown.js",
};

View File

@ -660,13 +660,7 @@ class Knowledge extends AddonBase {
}
if (saveFile) {
if (
(await new Zotero.Translate.Export().getTranslators()).filter(
(e) => e.translatorID === TRANSLATOR_ID_BETTER_MARKDOWN
)
) {
await loadTranslator(TRANSLATOR_ID_BETTER_MARKDOWN);
}
await loadTranslator(TRANSLATOR_ID_BETTER_MARKDOWN);
const filename = await pick(
Zotero.getString("fileInterface.export"),