# Unexpected behavior with article-locator

**URL:** <https://discourse.citationstyles.org/t/unexpected-behavior-with-article-locator/1825>\
**Category:** CSL Usage\
**Created:** [July 29, 2023, 11:51am UTC](https://discourse.citationstyles.org/t/unexpected-behavior-with-article-locator/1825 "2023-07-29T11:51:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![zepinglee](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/zepinglee/32/278_2.png) [@zepinglee](https://discourse.citationstyles.org/u/zepinglee)\
**Post date:** [July 29, 2023, 11:51am UTC](https://discourse.citationstyles.org/t/unexpected-behavior-with-article-locator/1825/1 "2023-07-29T11:51:09Z")

</div>

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:

```auto
      + 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.

```auto
>>===== 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 =====<<

```

---

<div class="post-metadata">

**Author:** ![Sebastian\_Karcher](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/sebastian_karcher/32/176_2.png) [@Sebastian\_Karcher](https://discourse.citationstyles.org/u/Sebastian_Karcher)\
**Post date:** [July 29, 2023, 12:28pm UTC](https://discourse.citationstyles.org/t/unexpected-behavior-with-article-locator/1825/2 "2023-07-29T12:28:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![zepinglee](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/zepinglee/32/278_2.png) [@zepinglee](https://discourse.citationstyles.org/u/zepinglee)\
**Post date:** [July 29, 2023, 2:23pm UTC](https://discourse.citationstyles.org/t/unexpected-behavior-with-article-locator/1825/3 "2023-07-29T14:23:31Z")

</div>

I try to make a patch in [zepinglee/citeproc-js@d022a4e](https://github.com/zepinglee/citeproc-js/commit/d022a4e0df24492cd16f85794e35e2323d97532f). 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](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.

 ![Screenshot 2023-07-29 at 22.18.18](https://canada1.discourse-cdn.com/flex029/uploads/citationstyles/original/1X/b724f97e99a5c85baee5e1ab68f5f19772a7fade.png)

---

<div class="post-metadata">

**Author:** ![StianOby](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/stianoby/32/451_2.png) [@StianOby](https://discourse.citationstyles.org/u/StianOby)\
**Post date:** [January 23, 2026, 10:33pm UTC](https://discourse.citationstyles.org/t/unexpected-behavior-with-article-locator/1825/4 "2026-01-23T22:33:22Z")

</div>

Did this get resolved? I think I may have run into this issue when attempting to write a CSL style, where I cannot seem to isolate the article-locator with choose.

The code in question is:

```auto
        <choose>
          <if locator="page">
           <group delimiter="&#160;">
              <label variable="locator" form="short"/>
              <text variable="locator"/>
            </group> 
          </if>
          <else-if locator="paragraph">
            <group delimiter=" ">
              <label variable="locator" form="long"/>
              <text variable="locator"/>
            </group>
          </else-if>
          <else-if locator="article-locator">
            <group delimiter=" ">
              <label variable="locator" form="long"/>
              <text variable="locator"/>
            </group>
          </else-if>
          <else>
            <group delimiter=" ">
              <label variable="locator" form="short"/>
              <text variable="locator"/>
            </group>
          </else>
        </choose>

```

With this code, the locator label for paragraph (“paragraph”) is printed in long form, as expected. However, the locator label for article (“article-locator”) is printed in short form. This despite the two else-if conditions being identical (apart form the locator term).

(I’m viewing the output in the Zotero Style Editor, which I reckon uses citeproc-js.)

---

<div class="post-metadata">

**Author:** ![zepinglee](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/zepinglee/32/278_2.png) [@zepinglee](https://discourse.citationstyles.org/u/zepinglee)\
**Post date:** [January 26, 2026, 6:13am UTC](https://discourse.citationstyles.org/t/unexpected-behavior-with-article-locator/1825/5 "2026-01-26T06:13:32Z")

</div>

This is just fixed in [juris-m/citeproc-js#263](https://github.com/Juris-M/citeproc-js/pull/263#issuecomment-3797285240).

---

<div class="post-metadata">

**Author:** ![StianOby](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/stianoby/32/451_2.png) [@StianOby](https://discourse.citationstyles.org/u/StianOby)\
**Post date:** [January 26, 2026, 7:37am UTC](https://discourse.citationstyles.org/t/unexpected-behavior-with-article-locator/1825/6 "2026-01-26T07:37:40Z")

</div>

Fantastic, thanks! How often does Zotero pull in updates from citeproc-js? Every minor version?

---

<div class="post-metadata">

**Author:** ![StianOby](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/stianoby/32/451_2.png) [@StianOby](https://discourse.citationstyles.org/u/StianOby)\
**Post date:** [January 29, 2026, 8:31am UTC](https://discourse.citationstyles.org/t/unexpected-behavior-with-article-locator/1825/7 "2026-01-29T08:31:13Z")

</div>

To answer my own question: this does not happen automatically for each minor Zotero version (8.0.1 did not include the fix), but I see that there is now an issue in the Zotero repo where one can track progress: [Pull in latest citeproc-js fixes · Issue #5767 · zotero/zotero · GitHub](https://github.com/zotero/zotero/issues/5767)

---

<div class="post-metadata">

**Author:** ![StianOby](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/stianoby/32/451_2.png) [@StianOby](https://discourse.citationstyles.org/u/StianOby)\
**Post date:** [May 7, 2026, 7:19am UTC](https://discourse.citationstyles.org/t/unexpected-behavior-with-article-locator/1825/8 "2026-05-07T07:19:39Z")

</div>

The PR has not been merged into citeproc-js, and Zotero has not pulled in the updated citeproc-js either. Since its now been over 3 months, this gets me wondering: is CSL/citeproc-js lacking active developers at the moment? Or are all efforts going into the new Citum processor?

EDIT: the article-locator issue was actually merged into citeproc-js. I was thinking of this similar issue, which has not yet been merged: [Fix name attributes with literal names (fix #271) by zepinglee · Pull Request #272 · Juris-M/citeproc-js · GitHub](https://github.com/Juris-M/citeproc-js/pull/272)
