Always keep serial numbers as verbatim - #508
Open
YDX-2147483647 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #506
In the current
docs/file-format.md, the type ofserial-numberis specified as string, not numeric or string:hayagriva/docs/file-format.md
Line 331 in 0eaceab
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) andtaxonomy.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.