Version 0.27.0
🚀 New Features
Support for Single-Quoted Attribute Values
You can now define attributes with values enclosed in single quotes, avoiding the need for additional escaping when double quotes are used within the attribute value itself.
Usage Examples
Below is an example of how you can utilize single-quoted attribute values in your Go code:
import (
"github.com/chasefleming/elem-go"
"github.com/chasefleming/elem-go/attrs"
)
func main() {
content := elem.Div(attrs.Props{
"data-values": `'{"quantity": 5}'`, // Single-quoted attribute value
})
html := content.Render()
fmt.Println(html)
}
This code will produce the following HTML output:
<div data-values='{"quantity": 5}'></div>