Unexpected behavior with article-locator

In the following fixture, the <label> is expected to render art. and <else-if locator="article-locator"> should test true for the cite item with "label": "article-locator". But the current citeproc-js gives:

      + expected - actual

       p. 42 is page
      -42 is other
      +art. 42 is article-locator
       art. 43 is other

The locator article (without -locator) seems to work but the validator complains “Bad value ‘article’ for attribute ‘locator’ on element ‘else-if’” and <else-if locator="article"> tests false.

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


>>===== RESULT =====>>
p. 42 is page
art. 42 is article-locator
art. 43 is other
<<===== RESULT =====<<


>>===== CITATION-ITEMS =====>>
[
    [
        {
            "id": "ITEM-1",
            "locator": "42",
            "label": "page"
        }
    ],
    [
        {
            "id": "ITEM-1",
            "locator": "42",
            "label": "article-locator"
        }
    ],
    [
        {
            "id": "ITEM-1",
            "locator": "43",
            "label": "article"
        }
    ]
]
<<===== CITATION-ITEMS =====<<


>>===== CSL =====>>
<style
      xmlns="http://purl.org/net/xbiblio/csl"
      class="note"
      version="1.0">
  <info>
    <id />
    <title />
    <updated>2023-07-29T19:35:54+08:00</updated>
  </info>
  <citation>
    <layout>
      <group delimiter=" ">
        <label variable="locator" form="short"/>
        <text variable="locator"/>
        <choose>
          <if locator="page">
            <text value="is page"/>
          </if>
          <else-if locator="article-locator">
            <text value="is article-locator"/>
          </else-if>
          <else-if locator="article">
            <text value="is article"/>
          </else-if>
          <else>
            <text value="is other"/>
          </else>
        </choose>
      </group>
    </layout>
  </citation>
</style>
<<===== CSL =====<<


>>===== INPUT =====>>
[
    {
        "id": "ITEM-1",
        "type": "legislation"
    }
]
<<===== INPUT =====<<


>>===== VERSION =====>>
1.0
<<===== VERSION =====<<

did article-locator just not make it into citeproc-js? There was some back-and-forth about naming, IIRC. If so, that’d seem to be a pretty easy fix.

I try to make a patch in zepinglee/citeproc-js@d022a4e. The variables in three related lines of JavaScript code are renamed to “article-locator”. There are also a bunch of test fixtures involving this locator and they are renamed as well in the commit. Luckily the patch passes the CI test (https://github.com/zepinglee/citeproc-js/actions/runs/5700789273) but I’m not confident enough that it has no side effects.

I also test the style in Zotero and it doesn’t work as well. We may need to check the exported locator label in CitationItem if this patch is accepted.