Skip to content

Commit d772c7c

Browse files
committed
Fix bib layout affixes
1 parent 49f24d5 commit d772c7c

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

src/csl/mod.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1588,7 +1588,15 @@ impl<'a> StyleContext<'a> {
15881588
let mut ctx = self.ctx(entry, props, locale, term_locale, true);
15891589
ctx.writing
15901590
.push_name_options(&self.csl.bibliography.as_ref()?.name_options);
1591-
self.csl.bibliography.as_ref()?.layout.render(&mut ctx);
1591+
1592+
let layout = &self.csl.bibliography.as_ref()?.layout;
1593+
if let Some(prefix) = layout.prefix.as_ref() {
1594+
ctx.push_str(prefix);
1595+
}
1596+
layout.render(&mut ctx);
1597+
if let Some(suffix) = layout.suffix.as_ref() {
1598+
ctx.push_str(suffix);
1599+
}
15921600
Some(ctx)
15931601
}
15941602

tests/citeproc-pass.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,25 @@ bugreports_ChineseCharactersFamilyOnlyPluralLabel
1616
bugreports_ContextualPluralWithMainItemFields
1717
bugreports_EmptyIfMatchNoneFail
1818
bugreports_MatchedAuthorAndDate
19+
bugreports_NoEventInNestedMacroWithOldProcessor
1920
bugreports_SectionAndLocator
2021
bugreports_SimpleBib
2122
bugreports_SingletonIfMatchNoneFail
23+
bugreports_StyleError001
2224
bugreports_TitleCase
2325
bugreports_UndefinedInName2
2426
bugreports_YearSuffixLingers
2527
bugreports_disambiguate
2628
bugreports_effingBug
29+
bugreports_parenthesis
2730
bugreports_undefinedCrash
2831
collapse_AuthorCollapse
2932
collapse_AuthorCollapseDifferentAuthorsOneWithEtAl
3033
collapse_AuthorCollapseNoDate
3134
collapse_CitationNumberRangesMixed
3235
collapse_CitationNumberRangesMixed2
3336
collapse_CitationNumberRangesMixed3
37+
collapse_CitationNumberRangesOneOnly
3438
collapse_NumericDuplicate
3539
collapse_NumericDuplicate2
3640
collapse_TrailingDelimiter
@@ -142,11 +146,13 @@ disambiguate_YearSuffixMacroSameYearExplicit
142146
disambiguate_YearSuffixMacroSameYearImplicit
143147
disambiguate_YearSuffixWithEtAlSubsequent
144148
display_DisplayBlock
149+
etal_CitationAndBibliographyDecorationsInBibliography
145150
flipflop_OrphanQuote
146151
form_TitleShort
147152
form_TitleShortNoLong
148153
form_TitleTestNoLongFalse
149154
fullstyles_APA
155+
fullstyles_ChicagoNoteWithBibliographyWithPublisher
150156
group_ShortOutputOnly
151157
group_SuppressValueWithEmptySubgroup
152158
group_SuppressWithEmptyNestedDateNode
@@ -234,6 +240,7 @@ name_QuashOrdinaryVariableRenderedViaSubstitute
234240
name_RomanianTwo
235241
name_SemicolonWithAnd
236242
name_SubsequentAuthorSubstituteMultipleNames
243+
name_SubsequentAuthorSubstituteSingleField
237244
name_SubstituteMacroInheritDecorations
238245
name_SubstituteName
239246
name_SubstituteOnDateGroupSpanFail
@@ -375,9 +382,11 @@ punctuation_DelimiterWithStripPeriodsAndSubstitute3
375382
punctuation_DoNotSuppressColonAfterPeriod
376383
punctuation_NoSuppressOfPeriodBeforeSemicolon
377384
quotes_Punctuation
385+
quotes_PunctuationNasty
378386
sort_BibliographyResortOnUpdate
379387
sort_CaseInsensitiveBibliography
380388
sort_CaseInsensitiveCitation
389+
sort_ChicagoYearSuffix1
381390
sort_Citation
382391
sort_CitationNumberPrimaryAscendingViaMacroBibliography
383392
sort_CitationNumberPrimaryAscendingViaVariableBibliography

tests/citeproc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ fn case_folding() {
768768
.content
769769
.write_buf(&mut buf, hayagriva::BufWriteFormat::Plain)
770770
.unwrap();
771-
assert_eq!(buf, ". my lowercase container title");
771+
assert_eq!(buf, ". my lowercase container title.");
772772
}
773773

774774
#[test]

0 commit comments

Comments
 (0)