zotero / citeproc-rs

CSL processor in Rust.
https://cormacrelf.github.io/citeproc-wasm-demo/
Other
75 stars 11 forks source link

Bug report: date-part affixes in range #147

Open zepinglee opened 2 years ago

zepinglee commented 2 years ago

2ab195a output:

Diff < left / right > :
<(2000)(November–(December)(9)(10)
<(2000)(November)(8–(9)
>(2000)(November)(10–December)(9)
>(2000)(November)(8–9)
  1. The order of date-part elements is not as expected as November 10–December 9.
  2. The date-part affix is be omitted if it's next to the date range delimiter.
>>===== MODE =====>>
citation
<<===== MODE =====<<

>>===== RESULT =====>>
(2000)(November)(10–December)(9)
(2000)(November)(8–9)
<<===== RESULT =====<<

>>===== CSL =====>>
<style
      xmlns="http://purl.org/net/xbiblio/csl"
      class="note"
      version="1.0">
  <info>
    <id />
    <title />
    <updated>2022-06-05T00:00:00+08:00</updated>
  </info>
  <citation>
    <layout>
      <date variable="issued">
        <date-part name="year" prefix="(" suffix=")"/>
        <date-part name="month" prefix="(" suffix=")"/>
        <date-part name="day" prefix="(" suffix=")"/>
      </date>
    </layout>
  </citation>
</style>
<<===== CSL =====<<

>>===== CITATION-ITEMS =====>>
[
    [
       {
         "id": "ITEM-1"
       }
    ],
    [
       {
         "id": "ITEM-2"
       }
    ]
]
<<===== CITATION-ITEMS =====<<

>>===== INPUT =====>>
[
    {
        "id": "ITEM-1",
        "type": "book",
        "issued": {
            "date-parts": [
                [
                    2000,
                    11,
                    10
                ],
                [
                    2000,
                    12,
                    9
                ]
            ]
        }
    },
    {
        "id": "ITEM-2",
        "type": "book",
        "issued": {
            "date-parts": [
                [
                    2000,
                    11,
                    8
                ],
                [
                    2000,
                    11,
                    9
                ]
            ]
        }
    }
]
<<===== INPUT =====<<