diff options
Diffstat (limited to 'src/dom')
| -rw-r--r-- | src/dom/Element.zig | 9 |
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. |
