Skip to content

Always keep serial numbers as verbatim - #508

Open
YDX-2147483647 wants to merge 1 commit into
typst:mainfrom
YDX-2147483647:serial
Open

Always keep serial numbers as verbatim#508
YDX-2147483647 wants to merge 1 commit into
typst:mainfrom
YDX-2147483647:serial

Conversation

@YDX-2147483647

@YDX-2147483647 YDX-2147483647 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Resolves #506

In the current docs/file-format.md, the type of serial-number is specified as string, not numeric or string:

| **Data type:** | string or dictionary of strings |

However at present, hayagriva tries to parse serial numbers as numeric numbers when .bib → .yaml and when .yaml → CSL variable.
Usually it fails, so serial numbers will be kept as verbatim as expected; but when it succeeded, the serial number is transformed unexpectedly.

#506 gives an example of the latter case: USDL-26-0599.
Without knowing it's a serial number, we may interpret it as a range from number 26 (with prefix USDL-) to number 599, and format it incorrectly as USDL-26–599 (USDL-26, en dash, 599).

To fix it, this PR removes the parsing logic for serial numbers from interop.rs (.bib → .yaml) and taxonomy.rs (.yaml → CSL variable).

Additional info

Leading zeros in serial numbers should be kept, but I'm not sure whether leading zeros in volumes should be kept.
Therefore, I intentionally construct test cases that do not involve volumes with leading zeros in this PR.
I or someone else may deal with it in future PRs.

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.

serial-number containing hyphens is parsed as a number range

1 participant