summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/description.rs16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/description.rs b/src/description.rs
index e835751..3697673 100644
--- a/src/description.rs
+++ b/src/description.rs
@@ -259,6 +259,9 @@ pub enum ParagraphPart
/// Informal table part.
InformalTable(InformalTable),
+
+ /// Paragraph part.
+ Paragraph(Paragraph),
}
impl FromElements for ParagraphPart
@@ -294,7 +297,7 @@ impl ParagraphPart
"inlineequation" => Self::InlineEquation,
"programlisting" => Self::ProgramListing,
"citerefentry" => Self::Entry,
- "variablelist" | "itemizedlist" | "informaltable" => |_| {
+ "variablelist" | "itemizedlist" | "informaltable" | "para" => |_| {
unreachable!();
},
_ => {
@@ -351,6 +354,13 @@ impl ParagraphPart
));
}
+ if tagged_element.name() == "para" {
+ return Ok(Self::Paragraph(
+ Paragraph::from_elements(tagged_element.child_elements())
+ .map_err(|err| ParagraphPartError::InvalidParagraph(Box::new(err)))?,
+ ));
+ }
+
let text_element = tagged_element
.child_elements()
.get_first_text_element()
@@ -391,4 +401,8 @@ pub enum ParagraphPartError
/// Invalid informal table.
#[error("Invalid informal table")]
InvalidInformalTable(#[source] Box<InformalTableError>),
+
+ /// Invalid paragraph.
+ #[error("Invalid paragraph")]
+ InvalidParagraph(#[source] Box<ParagraphError>),
}