Skip to content

Fix wrong ibid position, test transparent locators - #399

Merged
PgBiel merged 4 commits into
mainfrom
locator-pos-fix
Sep 26, 2025
Merged

PgBiel merged 4 commits into
mainfrom
locator-pos-fix

Conversation

@PgBiel

@PgBiel PgBiel commented Sep 26, 2025

Copy link
Copy Markdown
Contributor

According to the CSL spec1 (emphasis mine):

The presence of locators determines which position is assigned:

  • Preceding cite does not have a locator: if the current cite has a locator, the position of the current cite is “ibid-with-locator”. Otherwise the position is “ibid”.
  • Preceding cite does have a locator: if the current cite has the same locator, the position of the current cite is “ibid”. If the locator differs the position is “ibid-with-locator”. If the current cite lacks a locator its only position is “subsequent”.

Prior logic only checked if the locators differed in any way, assigning "ibid with locator" if so. But that included differing by the previous citation having a locator and the current one not having one, whereas that case should be handled differently per the spec, and the position should be subsequent instead.
(Related: #301, though that fixed a different bug.)

Added tests for transparent locators, which not only verify this behavior has been fixed but also properly test the additions in #299.

Footnotes

  1. https://docs.citationstyles.org/en/stable/specification.html#choose

@PgBiel
PgBiel requested a review from reknih September 26, 2025 02:42

@reknih reknih left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First I thought it was wrong, but upon closer inspection, the second branch says "This is none, last is some" so it matches the spec.

@PgBiel
PgBiel merged commit d15326c into main Sep 26, 2025
4 checks passed
@PgBiel
PgBiel deleted the locator-pos-fix branch September 26, 2025 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants