vyleung / logseq-logtero-plugin

a Logseq plugin to create pages for Zotero items using custom page titles and properties
MIT License
23 stars 1 forks source link

[feature] sanitize items in title of the note name (replace / with _ ) #1

Closed danieltomasz closed 2 years ago

danieltomasz commented 2 years ago

Great plugin! My problem - I have an example item/paper with a title Gao et al. (2017) Inferring synaptic excitation/inhibition balance from field potentials. Because of / a Logseq hierarchy is created and I want to avoid that.

vyleung commented 2 years ago

hi Daniel, thanks for this suggestion! this is pretty important - i'll work on adding this to the next release

danieltomasz commented 2 years ago

Also I am adding the abstract and authors to the page property, and if those vaulues cointains, I am getting many pages reflecting parts of the sentence.

Maybe would be useful the wrap the values in "", and especially for abstract to check if it the abstract doesnt contain another pair of quotes (and if yes, maybe sanitize it too?

vyleung commented 2 years ago

that's a good point. i think it may be safer to add quotes before and after the abstract and authors regardless if they have commas or not - one of the biggest frustrations w/ the native zotero integration for me was that it created a bunch of unnecessary pages

danieltomasz commented 2 years ago

What I mean is the situation as below Abstract: "Word "love" has many meanings, but we will discuss only one"

But such cases seems to be ok.

vyleung commented 2 years ago

v.1.0.1 should 1) replace / w/ _ and 2) surround the abstract and authors property values in quotes - let me know if this works for you

danieltomasz commented 2 years ago

@vyleung thanks for the update! I am now trying new release and the item with / doesn't appear at all ( note isn't created). I am uploading example bibliography with an item that is problematic Neuronal excitation/inhibition imbalance: core element of a translational perspective on Alzheimer pathophysiology Test.json.zip

vyleung commented 2 years ago

thanks for sending along your JSON file! i've tested it on my end, and it seems to work (see video). maybe try restarting Logseq or disabling then re-enabling the plugin?

https://user-images.githubusercontent.com/64292157/178155226-ee6ef846-502d-4125-9e38-c1ac100f08e8.mp4

danieltomasz commented 2 years ago

indeed, it works! (the first time I restated logseq it didn't)