From e2393c91b20f6f055539965f1ff606d3d1408189 Mon Sep 17 00:00:00 2001 From: PgBiel <9021226+PgBiel@users.noreply.github.com> Date: Tue, 6 Aug 2024 11:12:39 -0300 Subject: [PATCH] ensure variable sorting is case-insensitive --- src/csl/sort.rs | 4 ++-- tests/citeproc-pass.txt | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/csl/sort.rs b/src/csl/sort.rs index 1c8ab83..bcf9380 100644 --- a/src/csl/sort.rs +++ b/src/csl/sort.rs @@ -27,10 +27,10 @@ impl<'a> StyleContext<'a> { SortKey::Variable { variable: Variable::Standard(s), .. } => { let a = InstanceContext::sort_instance(a, a_idx) .resolve_standard_variable(LongShortForm::default(), *s) - .map(|s| s.to_string()); + .map(|s| s.to_string().to_lowercase()); let b = InstanceContext::sort_instance(b, b_idx) .resolve_standard_variable(LongShortForm::default(), *s) - .map(|s| s.to_string()); + .map(|s| s.to_string().to_lowercase()); a.cmp(&b) } diff --git a/tests/citeproc-pass.txt b/tests/citeproc-pass.txt index fcbbe72..c10d743 100644 --- a/tests/citeproc-pass.txt +++ b/tests/citeproc-pass.txt @@ -292,6 +292,7 @@ position_TrueInCitation punctuation_DateStripPeriods punctuation_DoNotSuppressColonAfterPeriod punctuation_NoSuppressOfPeriodBeforeSemicolon +sort_CaseInsensitiveCitation sort_Citation sort_CitationSecondaryKey sort_CiteGroupDelimiter