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

Bug report: Unexpected collapsing delimiter in APA style

zepinglee opened this issue · comments

This test case is taken from https://apastyle.apa.org/style-grammar-guidelines/citations/basic-principles/multiple-works and the CSL style is the latest released version (2022-10-02) of apa.csl. In the output, the last delimiter should be the same as others but a semicolon is actually produced.

      + expected - actual

      -(Zhou, n.d., 2000, 2016; in press)
      +(Zhou, n.d., 2000, 2016, in press)

The full fixture is in the attached file collapse_AuthorInPress.txt because it's too long to be published here. The following

>>===== MODE =====>>
citation
<<===== MODE =====<<


>>===== RESULT =====>>
(Zhou, n.d., 2000, 2016, in press)
<<===== RESULT =====<<


>>===== INPUT =====>>
[
    {
        "id": "ITEM-1",
        "type": "book",
        "author": [
            {
                "family": "Zhou",
                "given": "Tong"
            }
        ],
        "issued": {
            "date-parts": [
                [
                    2000
                ]
            ]
        }
    },
    {
        "id": "ITEM-2",
        "type": "book",
        "author": [
            {
                "family": "Zhou",
                "given": "Tong"
            }
        ],
        "issued": {
            "date-parts": [
                [
                    2016
                ]
            ]
        }
    },
    {
        "id": "ITEM-3",
        "type": "book",
        "author": [
            {
                "family": "Zhou",
                "given": "Tong"
            }
        ],
        "status": "in press"
    },
    {
        "id": "ITEM-4",
        "type": "book",
        "author": [
            {
                "family": "Zhou",
                "given": "Tong"
            }
        ]
    }
]
<<===== INPUT =====<<

A possible solution is adding explicit cite-group-delimiter=", " but I'm not sure if it has side effects. @bwiernik Do you have regression tests for APA style?

-  <citation et-al-min="3" et-al-use-first="1" disambiguate-add-year-suffix="true" disambiguate-add-names="true" disambiguate-add-givenname="true" collapse="year" givenname-disambiguation-rule="primary-name-with-initials">
+  <citation et-al-min="3" et-al-use-first="1" disambiguate-add-year-suffix="true" disambiguate-add-names="true" disambiguate-add-givenname="true" cite-group-delimiter=", " collapse="year" givenname-disambiguation-rule="primary-name-with-initials">