From a67d1b5bc2f8669102c30081a966e7a1b60e3fbc Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 2 Mar 2023 20:19:10 +0100 Subject: feat: add support for itemized list description parts --- src/description.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/description.rs b/src/description.rs index 5d0cb1f..e835751 100644 --- a/src/description.rs +++ b/src/description.rs @@ -101,6 +101,11 @@ impl FromElements for Description .map(Part::InformalTable) .map_err(Self::Error::InvalidInformalTable), ), + "itemizedlist" => Some( + ItemizedList::from_elements(part_elem.child_elements()) + .map(Part::ItemizedList) + .map_err(Self::Error::InvalidItemizedList), + ), "title" => None, name => Some(Err(Self::Error::UnknownPartFound(name.to_string()))), }) @@ -132,6 +137,10 @@ pub enum Error /// Invalid informal table. #[error("Invalid informal table")] InvalidInformalTable(#[source] InformalTableError), + + /// Invalid itemized list. + #[error("Invalid itemized list")] + InvalidItemizedList(#[source] ItemizedListError), } /// Description part. @@ -149,6 +158,9 @@ pub enum Part /// Informal table. InformalTable(InformalTable), + + /// Itemized list. + ItemizedList(ItemizedList), } /// Reference entry description paragraph. -- cgit v1.2.3-18-g5258