Skip to content

Commit

Permalink
update to latest main
Browse files Browse the repository at this point in the history
  • Loading branch information
PgBiel committed Aug 6, 2024
2 parents afb000e + af287f8 commit 248f8fc
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ archive = ["ciborium"]
csl-json = ["citationberg/json"]

[dependencies]
citationberg = { git = "https://github.com/typst/citationberg.git", rev = "858782e" }
citationberg = { git = "https://github.com/typst/citationberg.git", rev = "61ca6a7fcc48365f805e521cc8bc1f8f679ff372" }
indexmap = { version = "2.0.2", features = ["serde"] }
numerals = "0.1.4"
paste = "1.0.14"
Expand Down
4 changes: 0 additions & 4 deletions src/csl/rendering/names.rs
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,6 @@ fn write_name<T: EntryLike>(

if name.given_name.is_some() {
ctx.push_str(sort_sep);
ctx.ensure_space();

let idx = ctx.push_format(first_format);
let cidx = ctx.push_case(first_case);
Expand All @@ -680,7 +679,6 @@ fn write_name<T: EntryLike>(

if let Some(suffix) = &name.suffix {
ctx.push_str(sort_sep);
ctx.ensure_space();
ctx.push_str(suffix);
}
};
Expand All @@ -704,7 +702,6 @@ fn write_name<T: EntryLike>(

if name.given_name.is_some() {
ctx.push_str(sort_sep);
ctx.ensure_space();

let idx = ctx.push_format(first_format);
let cidx = ctx.push_case(first_case);
Expand Down Expand Up @@ -735,7 +732,6 @@ fn write_name<T: EntryLike>(

if let Some(suffix) = &name.suffix {
ctx.push_str(sort_sep);
ctx.ensure_space();
ctx.push_str(suffix);
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/selectors/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ impl Selector {
Self::Binding(binding, expr) => {
expr.apply_any(entries).map(|(mut bound, es)| {
if !es.is_empty() {
bound.insert(binding.to_string(), es.get(0).unwrap());
bound.insert(binding.to_string(), es.first().unwrap());
}
(bound, vec![])
})
Expand Down
13 changes: 6 additions & 7 deletions src/types/numeric.rs
Original file line number Diff line number Diff line change
Expand Up @@ -386,15 +386,14 @@ impl NumericValue {
let end = vec[1].0;
let first_delim = vec[0].1;

if start < end
&& (first_delim == Some(NumericDelimiter::Hyphen)
|| (first_delim == Some(NumericDelimiter::Ampersand)
&& start + 1 == end))
let first_delim_ampersand_range = first_delim
== Some(NumericDelimiter::Ampersand)
&& start + 1 == end;

if (first_delim_ampersand_range)
|| first_delim == Some(NumericDelimiter::Hyphen)
{
Some(start..=end)
} else if first_delim == Some(NumericDelimiter::Hyphen) {
// Handle shorthand notation like `100-4` for `100-104`
Some(start..=end)
} else {
None
}
Expand Down
2 changes: 2 additions & 0 deletions tests/citeproc-pass.txt
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ nameattr_NameFormOnNamesInCitation
nameattr_NameFormOnStyleInCitation
nameattr_NamesDelimiterOnBibliographyInCitation
nameattr_NamesDelimiterOnNamesInCitation
nameattr_SortSeparatorOnBibliographyInCitation
nameattr_SortSeparatorOnCitationInCitation
nameattr_SortSeparatorOnNamesInCitation
nameattr_SortSeparatorOnStyleInCitation
Expand Down Expand Up @@ -302,6 +303,7 @@ sort_DateVariableMixedElementsDescendingB
sort_LatinUnicode
sort_LocalizedDateLimitedParts
sort_TestInheritance
sortseparator_SortSeparatorEmpty
substitute_RepeatedNamesOk
substitute_SubstituteOnlyOnceString
substitute_SubstituteOnlyOnceTerm
Expand Down

0 comments on commit 248f8fc

Please sign in to comment.