aboutsummaryrefslogtreecommitdiff
path: root/src/dom/Element.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/dom/Element.zig')
-rw-r--r--src/dom/Element.zig9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/dom/Element.zig b/src/dom/Element.zig
index 524586c..6a9ac6e 100644
--- a/src/dom/Element.zig
+++ b/src/dom/Element.zig
@@ -34,6 +34,15 @@ pub fn init(alloc: Allocator, knd: Kind, tag: []const u8) !Self {
return v;
}
+pub fn initEmpty(alloc: Allocator) Self {
+ return .{
+ .kind = .content,
+ .arena = .init(alloc),
+ .attributes = .init(alloc),
+ .class_list = .init(alloc),
+ };
+}
+
/// Init a new literal element.
/// The literal content will never be escaped, see initLitEscaped if you want to escape it.
/// It always duplicates strings.