diff options
author | HampusM <hampus@hampusmat.com> | 2023-03-02 20:19:10 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2023-03-02 20:19:10 +0100 |
commit | a67d1b5bc2f8669102c30081a966e7a1b60e3fbc (patch) | |
tree | 724c4ac2ff3f7cb1b4ea554fcf8f60a8c15865bc | |
parent | 59e7cedcfb18a86bc8ffe4d8523c192c6025d735 (diff) |
feat: add support for itemized list description parts
-rw-r--r-- | src/description.rs | 12 |
1 files changed, 12 insertions, 0 deletions
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. |