Documentation
¶
Overview ¶
Package htmlio writes the small HTML fragments used by standard JaWS widgets.
Index ¶
- func AppendAttr(b []byte, name, value string) []byte
- func AppendAttrValue(b []byte, value string) []byte
- func Attr(name, value string) template.HTMLAttr
- func WriteHTMLInner(w io.Writer, jid jid.Jid, htmlTag, typeAttr string, innerHTML template.HTML, ...) (err error)
- func WriteHTMLInput(w io.Writer, jid jid.Jid, typeAttr, valueAttr string, ...) (err error)
- func WriteHTMLTag(w io.Writer, jid jid.Jid, htmlTag, typeAttr, valueAttr string, ...) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendAttr ¶ added in v0.406.0
AppendAttr appends a trusted attribute name with an escaped value.
The name parameter must be a trusted attribute name. The value parameter must be the unescaped logical attribute value; it is escaped for HTML source output by this function.
func AppendAttrValue ¶ added in v0.406.0
AppendAttrValue appends value as a double-quoted HTML attribute value.
The value parameter must be the unescaped logical attribute value. It is escaped for HTML source output by this function.
func Attr ¶ added in v0.406.0
Attr returns a trusted attribute name with an escaped value.
The name parameter must be a trusted attribute name. The value parameter must be the unescaped logical attribute value; it is escaped for HTML source output by this function.
func WriteHTMLInner ¶
func WriteHTMLInner(w io.Writer, jid jid.Jid, htmlTag, typeAttr string, innerHTML template.HTML, attrs ...template.HTMLAttr) (err error)
WriteHTMLInner writes an HTML element with trusted inner HTML.
Singleton tags such as img and input are written without closing tags unless innerHTML is non-empty.
func WriteHTMLInput ¶
func WriteHTMLInput(w io.Writer, jid jid.Jid, typeAttr, valueAttr string, attrs []template.HTMLAttr) (err error)
WriteHTMLInput writes an input start tag with optional id, type, value and raw attribute fragments.
The typeAttr and valueAttr parameters must be unescaped logical values; they are escaped for HTML source output. The attrs parameter contains trusted raw attribute fragments and is written as-is.
func WriteHTMLTag ¶
func WriteHTMLTag(w io.Writer, jid jid.Jid, htmlTag, typeAttr, valueAttr string, attrs []template.HTMLAttr) (err error)
WriteHTMLTag writes an HTML start tag with optional id, type, value and raw attribute fragments.
The typeAttr and valueAttr parameters must be unescaped logical values; they are escaped for HTML source output. The attrs parameter contains trusted raw attribute fragments and is written as-is.
Types ¶
This section is empty.