2023-10-27 21:48:19 +00:00
|
|
|
use crate::error::CustomError;
|
|
|
|
|
|
|
|
use super::registry::Registry;
|
|
|
|
|
|
|
|
#[derive(Debug)]
|
2023-10-29 16:06:40 +00:00
|
|
|
pub(crate) struct IFootnoteReference {
|
|
|
|
footnote_id: usize,
|
|
|
|
}
|
2023-10-27 21:48:19 +00:00
|
|
|
|
|
|
|
impl IFootnoteReference {
|
2023-10-29 16:15:07 +00:00
|
|
|
pub(crate) async fn new<'intermediate, 'parse>(
|
|
|
|
registry: &mut Registry<'intermediate, 'parse>,
|
|
|
|
original: &'intermediate organic::types::FootnoteReference<'parse>,
|
2023-10-27 21:48:19 +00:00
|
|
|
) -> Result<IFootnoteReference, CustomError> {
|
2023-10-29 16:06:40 +00:00
|
|
|
let footnote_id = registry.get_footnote_reference_id(original.label, &original.definition);
|
|
|
|
Ok(IFootnoteReference { footnote_id })
|
2023-10-27 21:48:19 +00:00
|
|
|
}
|
|
|
|
}
|