Skip to content

Commit

Permalink
Fix bib layout affixes
Browse files Browse the repository at this point in the history
  • Loading branch information
DerDrodt committed Oct 17, 2024
1 parent 49f24d5 commit d772c7c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/csl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1588,7 +1588,15 @@ impl<'a> StyleContext<'a> {
let mut ctx = self.ctx(entry, props, locale, term_locale, true);
ctx.writing
.push_name_options(&self.csl.bibliography.as_ref()?.name_options);
self.csl.bibliography.as_ref()?.layout.render(&mut ctx);

let layout = &self.csl.bibliography.as_ref()?.layout;
if let Some(prefix) = layout.prefix.as_ref() {
ctx.push_str(prefix);
}
layout.render(&mut ctx);
if let Some(suffix) = layout.suffix.as_ref() {
ctx.push_str(suffix);
}
Some(ctx)
}

Expand Down
9 changes: 9 additions & 0 deletions tests/citeproc-pass.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,25 @@ bugreports_ChineseCharactersFamilyOnlyPluralLabel
bugreports_ContextualPluralWithMainItemFields
bugreports_EmptyIfMatchNoneFail
bugreports_MatchedAuthorAndDate
bugreports_NoEventInNestedMacroWithOldProcessor
bugreports_SectionAndLocator
bugreports_SimpleBib
bugreports_SingletonIfMatchNoneFail
bugreports_StyleError001
bugreports_TitleCase
bugreports_UndefinedInName2
bugreports_YearSuffixLingers
bugreports_disambiguate
bugreports_effingBug
bugreports_parenthesis
bugreports_undefinedCrash
collapse_AuthorCollapse
collapse_AuthorCollapseDifferentAuthorsOneWithEtAl
collapse_AuthorCollapseNoDate
collapse_CitationNumberRangesMixed
collapse_CitationNumberRangesMixed2
collapse_CitationNumberRangesMixed3
collapse_CitationNumberRangesOneOnly
collapse_NumericDuplicate
collapse_NumericDuplicate2
collapse_TrailingDelimiter
Expand Down Expand Up @@ -142,11 +146,13 @@ disambiguate_YearSuffixMacroSameYearExplicit
disambiguate_YearSuffixMacroSameYearImplicit
disambiguate_YearSuffixWithEtAlSubsequent
display_DisplayBlock
etal_CitationAndBibliographyDecorationsInBibliography
flipflop_OrphanQuote
form_TitleShort
form_TitleShortNoLong
form_TitleTestNoLongFalse
fullstyles_APA
fullstyles_ChicagoNoteWithBibliographyWithPublisher
group_ShortOutputOnly
group_SuppressValueWithEmptySubgroup
group_SuppressWithEmptyNestedDateNode
Expand Down Expand Up @@ -234,6 +240,7 @@ name_QuashOrdinaryVariableRenderedViaSubstitute
name_RomanianTwo
name_SemicolonWithAnd
name_SubsequentAuthorSubstituteMultipleNames
name_SubsequentAuthorSubstituteSingleField
name_SubstituteMacroInheritDecorations
name_SubstituteName
name_SubstituteOnDateGroupSpanFail
Expand Down Expand Up @@ -375,9 +382,11 @@ punctuation_DelimiterWithStripPeriodsAndSubstitute3
punctuation_DoNotSuppressColonAfterPeriod
punctuation_NoSuppressOfPeriodBeforeSemicolon
quotes_Punctuation
quotes_PunctuationNasty
sort_BibliographyResortOnUpdate
sort_CaseInsensitiveBibliography
sort_CaseInsensitiveCitation
sort_ChicagoYearSuffix1
sort_Citation
sort_CitationNumberPrimaryAscendingViaMacroBibliography
sort_CitationNumberPrimaryAscendingViaVariableBibliography
Expand Down
2 changes: 1 addition & 1 deletion tests/citeproc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ fn case_folding() {
.content
.write_buf(&mut buf, hayagriva::BufWriteFormat::Plain)
.unwrap();
assert_eq!(buf, ". my lowercase container title");
assert_eq!(buf, ". my lowercase container title.");
}

#[test]
Expand Down

0 comments on commit d772c7c

Please sign in to comment.