-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
Parse page ranges following citeproc #155
Conversation
I have fixed the compile error and removed the provisional error message. I noticed that there were a few test regressions:
❌ Test label_EmptyLabelVanish should pass but failed
❌ Test locale_PageRangeDelimiterTermDefined should pass but failed ❌ Test locale_PageRangeDelimiterTermFrenchUndef should pass but failed ❌ Test number_PageFirst should pass but failed ❌ Test number_StrangeError should pass but failed ❌ Test page_Chicago should pass but failed ❌ Test page_Chicago16 should pass but failed ❌ Test page_NumberPageFirst should pass but failed ❌ Test page_PluralDetectWithEndash should pass but failed ❌ Test page_WithLocaleAndWeirdDelimiter should pass but failed ❌ Test virtual_PageFirst should pass but failed citeproc regressionsChicago, for example, seems to be reversed in terms of what numbers it omits. It would be great if you could check what's going wrong here and if there's a common cause! |
There was a minor bug in the page range formats for citationberg that I fixed. Besides that I put Look into the design changes, especially for citationberg, and let me know if you want something changed. |
I merged typst/citationberg#14 with two comments added, thank you!
|
From my POV this is good to merge. There might be further work down the line but this is worth an update imo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have made a few changes to the comparison functions and the resolve_page_variable
function. Thank you for your work!
if let NumberOrPageVariable::Number(v) = label.variable { | ||
n.is_plural(v.is_number_of_variable()) | ||
} else { | ||
panic!("Incompatiable variable types") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to enforce this on a type system level but it's okay for now
This PR depends on typst/citationberg#7.
Allows for
page-range
field to have multiple ranges, as in1-4 & 7-12, 13, 14\-19
.Each of these is split into parts:
,
&
13
14\-19
, where the hyphen will not be replaced by the given separator1-4
Ranges are given to citationberg to format depending on the format rule per the CSL spec.