diff --git a/src/dom/element/mod.rs b/src/dom/element/mod.rs index e43fce8..a5ce29b 100644 --- a/src/dom/element/mod.rs +++ b/src/dom/element/mod.rs @@ -11,6 +11,14 @@ pub struct Element { pre_text: String, } +#[macro_export] +macro_rules! element { + ($el:literal$(, $($content: expr),*)?) => { + Element::new($el) + $($(.append_child($content))*)? + }; +} + impl Element { pub fn new>(t: S) -> Self { Element {