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

Literature note title template can't handle colons. #156

Closed Zigurat9 closed 2 years ago

Zigurat9 commented 2 years ago

Desired title: The Field of Cultural Production: Essays on Art and Literature x What I get from Wish: The Field of Cultural Production_ Essays on Art and Literature

I am not a developer myself. I did see someone already digging into this issue but only within {{title}} when creating note template. Some pointed to specific workarounds but none seem to be casual-user friendly at this point. The {{title}} issue can be solved with quotes ("{{title}}") but the literature note title template doesn't really comply with this workaround.

tefkah commented 2 years ago

This is because Obsidian itself does not allow you to use colons in the title of notes. When you e.g. use it in the frontmatter, it works fine:

---
title: {{title}}
---

If you use The Field of Cultural Production: Essays on Art and Literature there it should just work, it only fails when in the actual title of the file.

My guess is that this is because they (Obsidian/author of this plugin) want to maintain compatibility with Windows, where filenames with colons are not allowed.

hans commented 2 years ago

This is correct, characters disallowed by filesystems are not allowed for use in note titles.

@Zigurat9 if you are not satisfied with the current solution (replacing disallowed characters with _) please suggest what you'd like to see instead. Thanks!

HotLoverGirl69 commented 1 year ago

@Zigurat9 if you are not satisfied with the current solution (replacing disallowed characters with _) please suggest what you'd like to see instead. Thanks!

I would prefer to replace them by an empty string i.e. foo: bar should become foo bar