diff --git a/src/csl/mod.rs b/src/csl/mod.rs index 0ea3f05..6f2492b 100644 --- a/src/csl/mod.rs +++ b/src/csl/mod.rs @@ -56,6 +56,7 @@ impl Default for BibliographyDriver<'_, T> { #[derive(Clone, Debug, PartialEq, Eq, Hash)] struct SpeculativeItemRender<'a, T: EntryLike> { rendered: ElemChildren, + rendered_without_ibid: ElemChildren, entry: &'a T, cite_props: CiteProperties<'a>, checked_disambiguate: bool, @@ -182,6 +183,17 @@ impl<'a, T: EntryLike + Hash + PartialEq + Eq + Debug> BibliographyDriver<'a, T> None, ); + let mut cite_props_without_ibid = cite_props.clone(); + cite_props_without_ibid.speculative.ibid = IbidState::Different; + let ctx_without_ibid = style.do_citation( + *entry, + cite_props_without_ibid, + item.locale.as_ref(), + citation.locale.as_ref(), + item.purpose, + None, + ); + // Copy the identifier usage from the context. Assume it does // not change throughout disambiguation. cite_props.speculative.identifier_usage = @@ -196,6 +208,7 @@ impl<'a, T: EntryLike + Hash + PartialEq + Eq + Debug> BibliographyDriver<'a, T> group_idx: None, locator: item.locator, rendered: ctx.flush(), + rendered_without_ibid: ctx_without_ibid.flush(), hidden: item.hidden, locale: item.locale.clone(), purpose: item.purpose, @@ -850,7 +863,7 @@ fn find_ambiguous_sets( continue; } - let buf = format!("{:?}", item.rendered); + let buf = format!("{:?}", item.rendered_without_ibid); match map.entry(buf) { HmEntry::Occupied(entry) => match *entry.get() { PotentialDisambiguation::Single(pos) => {