Wrap the intermediate Registry in an IntermediateContext.
This is currently just to maintain consistency with the render phase's RenderContext but in the future it should allow us to include immutable data that is not locked behind the ArcMutex.
This commit is contained in:
@@ -45,23 +45,23 @@ intermediate!(
|
||||
BlogPostPage,
|
||||
BlogPostPageInput<'orig, 'parse>,
|
||||
original,
|
||||
registry,
|
||||
intermediate_context,
|
||||
{
|
||||
let mut children = Vec::new();
|
||||
if let Some(section) = original.document.zeroth_section.as_ref() {
|
||||
children.push(IDocumentElement::Section(
|
||||
ISection::new(registry.clone(), section).await?,
|
||||
ISection::new(intermediate_context.clone(), section).await?,
|
||||
));
|
||||
}
|
||||
for heading in original.document.children.iter() {
|
||||
children.push(IDocumentElement::Heading(
|
||||
IHeading::new(registry.clone(), heading).await?,
|
||||
IHeading::new(intermediate_context.clone(), heading).await?,
|
||||
));
|
||||
}
|
||||
|
||||
let footnotes = {
|
||||
let footnote_definitions: Vec<_> = {
|
||||
let registry = registry.lock().unwrap();
|
||||
let registry = intermediate_context.registry.lock().unwrap();
|
||||
let ret = registry
|
||||
.get_footnote_ids()
|
||||
.map(|(id, def)| (id, def.clone()))
|
||||
@@ -70,7 +70,9 @@ intermediate!(
|
||||
};
|
||||
let mut ret = Vec::new();
|
||||
for (id, def) in footnote_definitions.into_iter() {
|
||||
ret.push(IRealFootnoteDefinition::new(registry.clone(), id, def).await?);
|
||||
ret.push(
|
||||
IRealFootnoteDefinition::new(intermediate_context.clone(), id, def).await?,
|
||||
);
|
||||
}
|
||||
ret
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user