Documentation
¶
Overview ¶
Package rp provides constructors and methods for the HTML <rp> element.
The <rp> HTML element provides fallback parentheses for browsers that don't support ruby annotations. Used exclusively within <ruby> elements to wrap parentheses that surround <rt> elements. Browsers that support ruby annotations hide this content, while older browsers display it to provide context for the ruby text. Essential for proper degradation of ruby annotations in legacy browsers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( TagOpen = []byte("<rp") TagClose = []byte("</rp>") )
Byte constants for HTML rendering.
Functions ¶
func New ¶
New creates a new rp element with optional child nodes. Example: rp.New(text.Text("(")) Renders: <rp>(</rp>
func RawText ¶
func RawText(content string) *element
RawText creates a new rp element with raw text content. Uses text.RawText which is not HTML-escaped. Example: rp.RawText("<span>(</span>") Renders: <rp><span>(</span></rp>
func RawTextf ¶
RawTextf creates a new rp element with formatted raw text content. Uses text.RawTextf which is not HTML-escaped. Example: rp.RawTextf("<span>%s</span>", bracket) Renders: <rp><span>(</span></rp>
func Static ¶
func Static(content string) *element
Static creates a new rp element with static text content. Uses text.Static which is not HTML-escaped and is JIT-optimisable. Example: rp.Static(")") Renders: <rp>)</rp>