Juris-M / citeproc-js

A JavaScript implementation of the Citation Style Language (CSL) https://citeproc-js.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why processCitationCluster silently exclude citation passed through citationPre or citationPost

ga676005 opened this issue · comments

I ran into a problem that processCitationCluster doesn't out as expected. I made an issue on citation-js citation-js/citation-js#196 and made a reproduction here https://github.com/ga676005/citation.js_csl-output-bug-reproduction. Now I think the issue would be more appropriate to deal on the citeproc-js side that's why I'm creating this issue.

So the problem I run into is that processCitationCluster(data,pre,post) can process the data even it doesn't have author field. But if the data only has one item that has no author. Later on when we call processCitationCluster(anotherData, dataInPre, post) for example. The output won't include the citation that created with data that passed through dataInPre. There is also no error in citation_errors returned from processCitationCluster in this situation. I found two case that won't have this issue. First is to manually inject [{ "given": "unknown", "family": "unknown" }] to the author field. Second is data has other item that has non-empty author field.

I had tried to use debugger to dig into the issue but I have no luck. I don't have much CSL or citation style knowledge so I am not sure whether a item has no author is "citatable" or not. Could you kindly give me advice what should I do?

I also found that with APA style if we have two entries and their first author are exactly the same, or the first author doesn't have both 'given' and 'family' properties. it would result in same error. My solution to this is add pattern plus random string to the author names to the input and remove them from the output. This is not a desirable solution but it is the closest one I can get.