diff options
| author | Anhgelus Morhtuuzh <william@herges.fr> | 2026-04-18 18:19:30 +0200 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <william@herges.fr> | 2026-04-18 18:19:30 +0200 |
| commit | 389691f4d11bf86c8be75927a2fbc01cff9c7059 (patch) | |
| tree | 42ea2d556b415daa361d73f1ffca2d521235f3fd /src/dom/Element.zig | |
| parent | c4f41ad2502567f641652eb745707d2c2817973b (diff) | |
feat(ast): parse content
Diffstat (limited to 'src/dom/Element.zig')
| -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. |
