refactor: consolidate shared utilities to runtime.zig

- Move isHtmlEntity to runtime.zig (was duplicated in codegen.zig and template.zig)
- Move appendTextEscaped to runtime.zig (was in template.zig)
- Add isXhtmlDoctype helper to runtime.zig for doctype detection
- Update template.zig to use codegen.void_elements instead of local isSelfClosing
- Update codegen.zig and zig_codegen.zig to use shared functions
- Update CLAUDE.md with shared utilities documentation

This establishes runtime.zig as the single source of truth for shared
utilities across all three rendering modes (codegen, template, zig_codegen).
This commit is contained in:
2026-01-29 22:27:57 +05:30
parent c7d53e56a9
commit b53aa16010
6 changed files with 132 additions and 162 deletions

View File

@@ -1,6 +1,6 @@
.{
.name = .pugz,
.version = "0.3.6",
.version = "0.3.7",
.fingerprint = 0x822db0790e17621d, // Changing this has security and trust implications.
.minimum_zig_version = "0.15.2",
.dependencies = .{},