hans / obsidian-citation-plugin

Obsidian plugin which integrates your academic reference manager with the Obsidian editor. Search your references from within Obsidian and automatically create and reference literature notes for papers and books.
MIT License
1.12k stars 83 forks source link

Citations not working on Obsidian Canvas #217

Open ghost opened 1 year ago

ghost commented 1 year ago

Describe the bug When I try to insert a citation from my litterature on a canvas file in Obsidian, it doesn't do anything.

To Reproduce Steps to reproduce the behavior:

  1. Go to a canvas file
  2. Double-click on the canvas anywhere to create a text box
  3. Bring up the command panel and click on "Citations: Insert litterature note content in the current pane"
  4. Nothing is inserted.

Console output app.js:1 Obsidian Developer Console plugin:obsidian-auto-link-title:250 loading obsidian-auto-link-title plugin:obsidian-banners:28 Loading Banners... plugin:dataview:20685 Dataview: version 0.5.47 (requires obsidian 0.13.11) plugin:obsidian-charts:79 loading plugin: Obsidian Charts plugin:customjs:163 Loading CustomJS plugin:obsidian-task-collector:539 loading Task Collector (TC) plugin:dataview:13951 Dataview: all 296 files have been indexed in 0.171s (296 cached, 0 skipped). TypeError: Cannot read properties of null (reading 'replaceRange') at CitationPlugin.eval (plugin:obsidian-citation-plugin:85866:29) at step (plugin:obsidian-citation-plugin:92:23) at Object.eval [as next] (plugin:obsidian-citation-plugin:73:53) at eval (plugin:obsidian-citation-plugin:66:71) at new Promise () at __awaiter (plugin:obsidian-citation-plugin:62:12) at CitationPlugin.insertLiteratureNoteContent (plugin:obsidian-citation-plugin:85862:16) at InsertNoteContentModal.onChooseItem (plugin:obsidian-citation-plugin:14823:21) at InsertNoteContentModal.t.onChooseSuggestion (app.js:1:1726362) at InsertNoteContentModal.t.selectSuggestion (app.js:1:1725912) Promise.catch (async) InsertNoteContentModal.onChooseItem @ plugin:obsidian-citation-plugin:14823 t.onChooseSuggestion @ app.js:1 t.selectSuggestion @ app.js:1 e.useSelectedItem @ app.js:1 e.onSuggestionClick @ app.js:1 s @ enhance.js:1

Expected behavior I expect to insert my chosen citation onto the canvas in the newly created text box.

Platform

andredelft commented 10 months ago

I've also seen this issue since the introduction of canvas on my mac (current OS version: 14.0). Would love to see this fixed!