Still needs a merging pass, and styles to be added (including numbering). These changes will require a re-work of constructing HTML elements though.
ZRGSUUICJKNHKVH2JZHHOKSSIQXNWCNLJX2ICSX524AG2XJKD3VAC
} else if let Some(list) = value.to::<ListElem>() {
Self::UnorderedList(list)
} else if let Some(list) = value.to::<EnumElem>() {
Self::OrderedList(list)
} else if let Some(item) = value.to::<ListItem>() {
Self::UnorderedListItem(item)
} else if let Some(item) = value.to::<EnumItem>() {
Self::OrderedListItem(item)
} else if let Some(pragraph_break) = value.to::<ParbreakElem>() {
Self::ParagraphBreak(pragraph_break)
SupportedContent::UnorderedList(list) => {
vec![xilem_html_element(
"ul",
vec![syn::Expr::Tuple(syn::ExprTuple {
attrs: Vec::new(),
paren_token: syn::token::Paren::default(),
elems: syn::punctuated::Punctuated::from_iter(
list.children()
.into_iter()
.map(|content| SupportedContent::downcast(content.body()))
.map(|supported| supported.to_xilem())
.flatten(),
),
})],
)]
}
SupportedContent::OrderedList(list) => {
vec![xilem_html_element(
"ol",
vec![syn::Expr::Tuple(syn::ExprTuple {
attrs: Vec::new(),
paren_token: syn::token::Paren::default(),
elems: syn::punctuated::Punctuated::from_iter(
list.children()
.into_iter()
.map(|content| SupportedContent::downcast(content.body()))
.map(|supported| supported.to_xilem())
.flatten(),
),
})],
)]
}
SupportedContent::UnorderedListItem(item) => {
vec![xilem_html_element(
"ul",
vec![xilem_html_element(
"li",
vec![syn::Expr::Tuple(syn::ExprTuple {
attrs: Vec::new(),
paren_token: syn::token::Paren::default(),
elems: syn::punctuated::Punctuated::from_iter(
SupportedContent::downcast(item.body()).to_xilem(),
),
})],
)],
)]
}
SupportedContent::OrderedListItem(item) => {
vec![xilem_html_element(
"ol",
vec![xilem_html_element(
"li",
vec![syn::Expr::Tuple(syn::ExprTuple {
attrs: Vec::new(),
paren_token: syn::token::Paren::default(),
elems: syn::punctuated::Punctuated::from_iter(
SupportedContent::downcast(item.body()).to_xilem(),
),
})],
)],
)]
}
SupportedContent::ParagraphBreak(_parahraph_break) => {
vec![xilem_html_element(
"br",
vec![syn::Expr::Tuple(syn::ExprTuple {
attrs: Vec::new(),
paren_token: syn::token::Paren::default(),
elems: syn::punctuated::Punctuated::new(),
})],
)]
}