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

display cite key for Markdown links #271

Open goi42 opened 2 months ago

goi42 commented 2 months ago

Right now, if the cite key contains unsafe characters for a path, the displayed title for the Markdown link has those characters replaced with _. This is not necessary and obscures the actual cite key. Details below.


The function getTitleForCitekey creates a title for the literature note, in part by replacing unsafe characters in the cite key: https://github.com/hans/obsidian-citation-plugin/blob/2edeeceaf5f38de90f77f111ab46d24eef3e0bfa/src/main.ts#L306-L311

The function insertLiteratureNoteLink uses this title to create the link to the note:

https://github.com/hans/obsidian-citation-plugin/blob/2edeeceaf5f38de90f77f111ab46d24eef3e0bfa/src/main.ts#L383-L393

This is correct for Wiki style links, which must use the path name, but this is not necessary for Markdown links, which could use the actual cite key as the displayed title while still using the safe title for the path name.