Documentation
¶
Overview ¶
Package em provides constructors and methods for the HTML <em> element.
The <em> HTML element marks text that has stress emphasis. The <em> element can be nested, with each level of nesting indicating a greater degree of emphasis.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( TagOpen = []byte("<em") TagClose = []byte("</em>") )
Byte constants for HTML rendering.
Functions ¶
func New ¶
New creates a new em element with the given child nodes. Example: em.New(text.Text("now")) Renders: <em>now</em>
func RawText ¶
func RawText(str string) *element
RawText creates a new em element with raw text content. Uses text.RawText which is not HTML-escaped. Example: em.RawText("<b>now</b>") Renders: <em><b>now</b></em>
func RawTextf ¶
RawTextf creates a new em element with formatted raw text content. Uses text.RawTextf which is not HTML-escaped. Example: em.RawTextf("<strong>%s</strong>", word) Renders: <em><strong>emphasis</strong></em>
func Static ¶
func Static(str string) *element
Static creates a new em element with static text content. Uses text.Static which is not HTML-escaped and is JIT-optimisable. Example: em.Static("must") Renders: <em>must</em>