Introduces the go-html module with a Node rendering interface, Raw and El constructors, void element handling, and attribute escaping. Includes a minimal Context stub and tests for all node types. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
15 lines
308 B
Go
15 lines
308 B
Go
package html
|
|
|
|
// Context carries rendering state through the node tree.
|
|
type Context struct {
|
|
Identity string
|
|
Locale string
|
|
Data map[string]any
|
|
}
|
|
|
|
// NewContext creates a new rendering context with sensible defaults.
|
|
func NewContext() *Context {
|
|
return &Context{
|
|
Data: make(map[string]any),
|
|
}
|
|
}
|