go-html/render.go
Virgil ae286563fd
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
fix(html): normalise nil render context
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-03 18:05:06 +00:00

11 lines
295 B
Go

package html
// render.go: Render is a convenience function that renders a node tree to HTML.
// Example: Render(NewLayout("C").C(Raw("body")), NewContext()).
func Render(node Node, ctx *Context) string {
ctx = normaliseContext(ctx)
if node == nil {
return ""
}
return node.Render(ctx)
}