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

Properties Error #257

Open cosmic-hobo opened 12 months ago

cosmic-hobo commented 12 months ago

Describe the bug For those literature items with a subtitle (with an auto-generated colon), obsidian displays a properties error. Since the update to V 1.4.16 on October 13, 2023, the error displays in red (see picture). The literatrue items with a single title are not affected by these behavior.

To Reproduce The error occurs when a literature note is created ("citation: open literature note")

Console output Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'removeGlobalClasses') at Zen.saveSettings (plugin:zen:464:18)

Expected behavior The properties ought to be displayed in black (see example below)

Screenshots literature item with error Screenshot from 2023-11-27 10-41-41

literature item without error Screenshot from 2023-11-27 10-42-15

Platform

orionpilot commented 11 months ago

I've gotten around the colon not being valid YAML by adding quotes around the relevant fields in the citations template, e.g., "{{title}}" rather than {{title}} directly.

cosmic-hobo commented 11 months ago

that's a great workaround, thank you!

m-hrachov commented 10 months ago

Hi! How do you render the creation date? By me, it omits the normal {{date}} or {{time}} whenever I want to add it ...

cosmic-hobo commented 10 months ago

that's what is in my template:

creation date: <% tp.file.creation_date("DD-MM-YYYY HH:mm") %>

m-hrachov commented 10 months ago

Thanks! Had to toggle "use Templater on new notes" - your answer helped me to get to this conclusion!