Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/csl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ impl<T: EntryLike> Default for BibliographyDriver<'_, T> {
#[derive(Clone, Debug, PartialEq)]
struct SpeculativeItemRender<'a, T: EntryLike> {
rendered: ElemChildren,
rendered_without_ibid: ElemChildren,
entry: &'a T,
cite_props: CiteProperties<'a>,
checked_disambiguate: bool,
Expand Down Expand Up @@ -185,6 +186,17 @@ impl<T: EntryLike + Hash + PartialEq + Eq + Debug> BibliographyDriver<'_, 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 =
Expand All @@ -199,6 +211,7 @@ impl<T: EntryLike + Hash + PartialEq + Eq + Debug> BibliographyDriver<'_, T> {
group_idx: None,
locator: item.locator.clone(),
rendered: ctx.flush(),
rendered_without_ibid: ctx_without_ibid.flush(),
hidden: item.hidden,
locale: item.locale.clone(),
purpose: item.purpose,
Expand Down Expand Up @@ -862,7 +875,7 @@ fn find_ambiguous_sets<T: EntryLike + PartialEq>(
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) => {
Expand Down
Loading