Skip to content

Commit

Permalink
fix: error when multiple attachments (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgrieser committed Mar 29, 2024
1 parent fa167cb commit 66bc027
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ specified in your workflow settings.
queries (see: [smart queries](#search)).
- A `📎` indicates that the BibTeX entry has a `file` or `attachment` field. You
can use <kbd>⌃</kbd><kbd>⌥</kbd><kbd>⌘</kbd><kbd>⏎</kbd> to open the
attachment.
attachment. If there are multiple attachments, the first one is opened.

### Link Preview
- Install the
Expand Down
4 changes: 3 additions & 1 deletion scripts/write-citation-picker-buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,9 @@ function bibtexParse(rawBibtexStr) {
}
case "file":
case "attachment": {
entry.attachment = value;
// see https://github.com/chrisgrieser/alfred-bibtex-citation-picker/issues/45
const multipleAttachments = value.includes(";/Users/");
entry.attachment = multipleAttachments ? value.split(";/Users/")[0] : value;
break;
}
default:
Expand Down

0 comments on commit 66bc027

Please sign in to comment.