Replaces ElementBlock
struct in favour of xilem_html_element
function, and adds the following:
JCYJWUI32EEUQVQBLUNTSWZI6OXZJIRQMDU72DXWTJVU2LJJ6QWQC
struct ElementBlock<'a> {
name: &'a str,
expression: syn::Expr,
}
impl ElementBlock<'_> {
fn method_call(self) -> syn::Expr {
let expr_call = syn::ExprCall {
attrs: Vec::new(),
func: Box::new(expr_path(self.name)),
paren_token: syn::token::Paren::default(),
args: Punctuated::from_iter([self.expression].into_iter()),
};
syn::Expr::Call(expr_call)
}
fn xilem_html_element(name: &str, expression: syn::Expr) -> syn::Expr {
syn::Expr::Call(syn::ExprCall {
attrs: Vec::new(),
func: Box::new(expr_path(name)),
paren_token: syn::token::Paren::default(),
args: Punctuated::from_iter([expression].into_iter()),
})
pandoc_ast::Inline::Superscript(inlines) => {
xilem_html_element("sup", transform_inlines(inlines))
}
pandoc_ast::Inline::Emph(inlines) => xilem_html_element("b", transform_inlines(inlines)),
pandoc_ast::Inline::Underline(inlines) => {
xilem_html_element("u", transform_inlines(inlines))
}
pandoc_ast::Inline::Strikeout(inlines) => {
xilem_html_element("s", transform_inlines(inlines))
}