diff options
-rw-r--r-- | src/description.rs | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/description.rs b/src/description.rs index 615b0c2..3a5b26f 100644 --- a/src/description.rs +++ b/src/description.rs @@ -280,6 +280,9 @@ pub enum ParagraphPart /// Table part. Table(Table), + + /// Informal equation part. + InformalEquation(String), } impl FromElements for ParagraphPart @@ -316,7 +319,7 @@ impl ParagraphPart "programlisting" => Self::ProgramListing, "citerefentry" => Self::Entry, "variablelist" | "itemizedlist" | "informaltable" | "para" | "footnote" - | "table" => |_| { + | "table" | "informalequation" => |_| { unreachable!(); }, _ => { @@ -392,6 +395,16 @@ impl ParagraphPart return Ok(Self::Table(table)); } + if tagged_element.name() == "informalequation" { + return Ok(Self::InlineEquation( + tagged_element + .child_elements() + .into_iter() + .map(ToString::to_string) + .collect::<String>(), + )); + } + let text_element = tagged_element .child_elements() .get_first_text_element() @@ -409,8 +422,8 @@ pub enum ParagraphPartError #[error("Expected a text element")] ExpectedTextElement, - /// A input element is a unknown description part. - #[error("Input element with name '{0}' is a unknown description part")] + /// A input element is a unknown paragraph part. + #[error("Input element with name '{0}' is a unknown paragraph part")] UnknownPart(String), /// No text was found in tagged input element. |