timlrx / rehype-citation

Rehype plugin to add citation and bibliography from bibtex files
https://rehype-citation.netlify.app
MIT License
38 stars 7 forks source link

bug: regression made from #44 #50

Open aarnphm opened 1 week ago

aarnphm commented 1 week ago

With 2.1.2, doing the following works with relative path when importing bibliography file:

[rehypeCitation, {
  bibliography: ["./content/References.bib", "https://...."], ...
}]

However,in 2.2.0, the path resolution somehow was concatenated twice with the same configuration:

ENOENT: no such file or directory, open '/Users/repo/workspace/garden/Users/repo/workspace/garden/content/References.bib'
timlrx commented 1 week ago

Do you have a small reproducible example or repository that I can try out? Can't seem to replicate the issue on my end, thanks

aarnphm commented 1 week ago

I made a repo here https://github.com/aarnphm/citation-repo

edit: hmm it seems like I can't reproduce it anymore. let me check from my end

edit 2: it seems like I can only reproduce it in my private repo, here is the recording for it

This is 2.1.2

https://github.com/user-attachments/assets/73738eb4-9ca2-4e26-bc7a-677fb3dad62b

and this is 2.2.0

https://github.com/user-attachments/assets/098abc71-4cb2-4e35-bf98-9fba673ec3eb

And the plugin are in the same config with citation-repo

timlrx commented 6 days ago

This is tricky to resolve since I can't reproduce it. Could some other plugins mistakenly modify the paths? Could you try using rehype-citation as the only rehype plugin? Also, does it work if you only provide one bib file?

aarnphm commented 6 days ago

modifying cwd? I don't think so otherwise, previous version would also fail right?

It works if there is only one bib file (strange)

timlrx commented 6 days ago

I meant the plugins over here: https://github.com/aarnphm/citation-repo/blob/1b80d71958dec02f8312934adf833a6643e43750/quartz.config.ts#L56-L100.

I don't see how the change from v2.1.2 to v2.2 would affect this so there's probably something else affecting the paths...

aarnphm commented 6 days ago

None of them modify path afaik. but a single bib path works so I'm not entirely sure how that works