Skip to content

Commit

Permalink
Fix misc errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mgmeyers committed Mar 31, 2022
1 parent 37e6a96 commit c3dcfbe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "obsidian-zotero-desktop-connector",
"name": "Zotero Desktop Connector",
"version": "1.1.5",
"version": "1.1.6",
"minAppVersion": "0.12.0",
"description": "Insert citations, bibliographies, and notes directly from Zotero desktop.",
"author": "mgmeyers",
Expand Down
4 changes: 2 additions & 2 deletions src/bbt/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export async function exportToMarkdown(
const attachments = itemData[i].attachments;
for (let j = 0, jLen = attachments.length; j < jLen; j++) {
const pdfInputPath = attachments[j].path;
if (!pdfInputPath.endsWith(".pdf")) continue;
if (!pdfInputPath?.endsWith(".pdf")) continue;

const pathTemplateData = {
...itemData[i],
Expand Down Expand Up @@ -324,7 +324,7 @@ export async function pdfDebugPrompt(settings: ZoteroConnectorSettings) {
const attachments = itemData[i].attachments;
for (let j = 0, jLen = attachments.length; j < jLen; j++) {
const pdfInputPath = attachments[j].path;
if (!pdfInputPath.endsWith(".pdf")) continue;
if (!pdfInputPath?.endsWith(".pdf")) continue;

let annots: any;

Expand Down
4 changes: 2 additions & 2 deletions src/bbt/exportNotes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export async function newFile(
citeKey: string,
content: string
) {
const target = !folder.endsWith("/") ? folder + "/" : folder;
const target = folder.replace(/(?:^\/|\/$)/g, "");

if (!app.vault.getAbstractFileByPath(target)) {
try {
Expand All @@ -75,7 +75,7 @@ export async function newFile(
}

try {
return await app.vault.create(`${target}${citeKey}.md`, content);
return await app.vault.create(`${target}/${citeKey}.md`, content);
} catch (e) {
console.error(e);
new Notice(
Expand Down

0 comments on commit c3dcfbe

Please sign in to comment.