Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(1) add logseq pdf open support (2) typeerror isNote #221

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,5 @@ docs/.obsidian
npm-debug.log*
yarn-debug.log*
yarn-error.log*

package-lock.json
22 changes: 14 additions & 8 deletions content/mdnotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,17 @@ function getRelatedItems(item) {

// Get the link content based on settings and item type
let linkContent;
if (!relatedItem.isNote()) {
linkContent = getMDNoteFileName(relatedItem);
} else if (relatedItem.isNote() && !relatedItem.isTopLevelItem()) {
linkContent = getZNoteFileName(relatedItem);
} else {
linkContent = relatedItem.getField("title");
if (relatedItem) {
if (!relatedItem.isNote()) {
linkContent = getMDNoteFileName(relatedItem);
} else if (relatedItem.isNote() && !relatedItem.isTopLevelItem()) {
linkContent = getZNoteFileName(relatedItem);
} else {
linkContent = relatedItem.getField("title");
}

relatedItemsArray.push(linkContent);
}

relatedItemsArray.push(linkContent);
}
}

Expand Down Expand Up @@ -293,6 +295,10 @@ function getZoteroAttachments(item) {
link = `[${attachment.getField("title")}](${getZoteroPDFLink(attachment)})`;
} else if (linkStylePref === "wiki") {
link = formatInternalLink(attachment.getField("title"), "wiki");
} else if (linkStylePref === "logseq") {
link = `[${attachment.getField("title")}](${getZoteroPDFLink(attachment)}) {{zotero-linked-file "${attachment.getField("title")}}}"`;
} else if (linkStylePref === "logseq-simple") {
link = `[zotero](${getZoteroPDFLink(attachment)}) {{zotero-linked-file "${attachment.getField("title")}"}}`;
} else {
link = `[${attachment.getField("title")}](${getPDFFileLink(attachment)})`;
}
Expand Down