Documentation ¶
Overview ¶
Package safe provides template functions for escaping untrusted content or encapsulating trusted content.
Index ¶
- type Namespace
- func (ns *Namespace) CSS(s any) (template.CSS, error)
- func (ns *Namespace) HTML(s any) (template.HTML, error)
- func (ns *Namespace) HTMLAttr(s any) (template.HTMLAttr, error)
- func (ns *Namespace) JS(s any) (template.JS, error)
- func (ns *Namespace) JSStr(s any) (template.JSStr, error)
- func (ns *Namespace) SanitizeURL(s any) (string, error)
- func (ns *Namespace) URL(s any) (template.URL, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Namespace ¶
type Namespace struct{}
Namespace provides template functions for the "safe" namespace.
func New ¶
func New() *Namespace
New returns a new instance of the safe-namespaced template functions.
func (*Namespace) SanitizeURL ¶
SanitizeURL returns the string s as html/template URL content.
Click to show internal directories.
Click to hide internal directories.