Wrap inline footnote definitions in a paragraph tag.

This is to match the behavior of the upstream org html exporter.
This commit is contained in:
Tom Alexander 2023-12-21 18:09:43 -05:00
parent 01b55b7256
commit 4fb08bc7d0
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
2 changed files with 24 additions and 2 deletions

View File

@ -29,3 +29,16 @@ intermediate!(
})
}
);
impl IParagraph {
pub(crate) async fn artificial<'orig, 'parse>(
_intermediate_context: crate::intermediate::IntermediateContext<'orig, 'parse>,
children: Vec<IObject>,
post_blank: organic::types::PostBlank,
) -> Result<IParagraph, CustomError> {
Ok(IParagraph {
children,
post_blank,
})
}
}

View File

@ -5,6 +5,8 @@ use std::collections::HashMap;
use super::ast_node::IAstNode;
use super::ast_node::IntoIAstNode;
use super::IObject;
use super::IParagraph;
use super::IntermediateContext;
type IdCounter = u16;
@ -148,13 +150,20 @@ async fn convert_reference_contents<'orig, 'parse>(
intermediate_context: IntermediateContext<'orig, 'parse>,
contents: &'orig Vec<Object<'parse>>,
) -> Result<Vec<IAstNode>, CustomError> {
let contents = {
let children = {
let mut ret = Vec::new();
for obj in contents.iter() {
ret.push(obj.into_ast_node(intermediate_context.clone()).await?);
ret.push(IObject::new(intermediate_context.clone(), obj).await?);
}
ret
};
let containing_paragraph =
IParagraph::artificial(intermediate_context.clone(), children, 0).await?;
let contents = {
let mut ret = Vec::new();
ret.push(IAstNode::Paragraph(containing_paragraph));
ret
};
Ok(contents)
}