Assign the reference counts.
This commit is contained in:
@@ -10,11 +10,11 @@ pub(crate) struct IFootnoteReference {
|
||||
}
|
||||
|
||||
intermediate!(IFootnoteReference, FootnoteReference, original, registry, {
|
||||
let footnote_id =
|
||||
let (footnote_id, reference_count) =
|
||||
get_footnote_reference_id(registry, original.label, &original.definition).await?;
|
||||
Ok(IFootnoteReference {
|
||||
footnote_id,
|
||||
duplicate_offset: 0, // TODO
|
||||
duplicate_offset: reference_count,
|
||||
})
|
||||
});
|
||||
|
||||
@@ -31,7 +31,7 @@ impl IFootnoteReference {
|
||||
format!("fnr.{}", self.get_display_label())
|
||||
} else {
|
||||
// Org-mode makes all duplicates use "100" but I figure there is no harm in giving each a unique ID.
|
||||
let append = 100 + self.duplicate_offset;
|
||||
let append = 100 + self.duplicate_offset - 1;
|
||||
format!("fnr.{}.{}", self.get_display_label(), append)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user