go-html/render.go
Virgil 0318d73a12
All checks were successful
Security Scan / security (push) Successful in 15s
Test / test (push) Successful in 43s
fix(core): harden nil-safe rendering paths
- guard nil receivers and nodes in core render flows
- make Render() safe for nil input
- add compile-time Node contract for Responsive

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-29 23:10:48 +00:00

13 lines
307 B
Go

package html
// Render is a convenience function that renders a node tree to HTML.
// Usage example: html := Render(El("main", Text("welcome")), NewContext())
func Render(node Node, ctx *Context) string {
if node == nil {
return ""
}
if ctx == nil {
ctx = NewContext()
}
return node.Render(ctx)
}