Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( TagOpen = []byte("<s") TagClose = []byte("</s>") )
Byte constants for HTML rendering.
Functions ¶
func New ¶
New Creates a new s element with optional child nodes. Examples: s.New() renders <s></s> s.New(text.Text("Old price: $100")) renders <s>Old price: $100</s>
func RawText ¶
func RawText(content string) *element
RawText Creates a new s element with raw text content. Uses text.RawText which is not HTML-escaped. Example: s.RawText("<strong>$100</strong>") Renders: <s><strong>$100</strong></s>
func RawTextf ¶ added in v0.3.0
RawTextf Creates a new s element with formatted raw text content. Uses text.RawTextf which is not HTML-escaped. Example: s.RawTextf("<em>Was $%d</em>", oldPrice) Renders: <s><em>Was $50</em></s>
func Static ¶
func Static(content string) *element
Static Creates a new s element with static text content. Uses text.Static which is not HTML-escaped and is JIT-optimisable. Example: s.Static("No longer available") Renders: <s>No longer available</s>