Files
organic/src/wasm/strike_through.rs

35 lines
852 B
Rust
Raw Normal View History

use serde::Deserialize;
use serde::Serialize;
use super::ast_node::WasmAstNode;
use super::macros::to_wasm;
use super::to_wasm::ToWasm;
2023-12-30 22:02:43 -05:00
use crate::util::elisp_fact::ElispFact;
use crate::types::StrikeThrough;
use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize, Deserialize)]
2023-12-29 23:41:15 -05:00
pub struct WasmStrikeThrough {}
to_wasm!(
2023-12-29 12:49:43 -05:00
WasmStrikeThrough,
2023-12-25 11:51:39 -05:00
StrikeThrough<'s>,
2023-12-25 12:32:35 -05:00
original,
wasm_context,
{ WasmAstNode::StrikeThrough(original) },
2023-12-29 23:41:15 -05:00
{ "strike-through".into() },
{
let children = original
.children
.iter()
.map(|child| {
child
.to_wasm(wasm_context.clone())
.map(Into::<WasmAstNode>::into)
})
.collect::<Result<Vec<_>, _>>()?;
2023-12-29 23:41:15 -05:00
Ok((children, WasmStrikeThrough {}))
}
);