-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change PageRangeFormat::format
to follow Pandoc
#7
Conversation
I share your preference to keep the user-specified separator. With Hayagriva's new test allow-list, we can explicitly opt out of some of citeproc's tests. I see the boundary between |
That makes sense. In that case, we should have our own tests in the same format to test the new behavior. I also found that according to the CSL docs we should only replace hyphens if the attribute was set. There also is no mention of a default for
I agree. My proposal is this:
That seems to be the desired behavior. |
I apologize for my late answer! If the CSL spec does not want us to remove hyphens if the attribute isn't set we shall not. I think that the Your proposal looks good to me! |
I updated this PR. I am preparing a PR for hayagriva. When this is merged, I can use it in hayagriva to incorporate the things we discussed. |
Thank you! Do you need a breaking citationberg release right away or do we expect more changes? |
No need for a new release. It is already set to use the git repo. |
(This is a big change; I apologize.)
This PR changes formatting of page ranges entirely. In summary
PageRangeFormat::format
no longer acceptsstart
andend
parameters of typei32
but&str
to handle prefixes better.8n11564-8n1568
is formatted to8n11564–68
by Chicago15. (The prefix must be identical for start and end of the range!)I followed the Haskell implementation of pandoc pretty closely, while trying to be as efficient as possible and writing it like one would in Rust. I would not be surprised if it can be optimized further.
Three points should be cleared up before merging:
123N110 - N5
is turned to123N110-N5
byExpanded
(note that no en-dash is used!). I would prefer the given separator instead of the normal dash. This is a matter of taste. Answer: We should use the given separator.Library
expose the structure of the ranges without rendering using CSL or should it be seen as part of CSL? Answer: See comment below.page-range-format
? Answer: no.This would be the second API change to citationberg. If merged, we should have a new version.