Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( TagOpen = []byte("<math") TagClose = []byte("</math>") AttrDisplay = []byte(" display=\"") AttrMathVariant = []byte(" mathvariant=\"") AttrXmlns = []byte(" xmlns=\"") )
Byte constants for HTML rendering.
Functions ¶
func New ¶
New Creates a new math element with optional child nodes. Example: math.New() Renders: <math></math>
func RawText ¶
func RawText(str string) *element
RawText Creates a new math element with raw text content. Uses text.RawText which is not HTML-escaped. Example: math.RawText("<mi>x</mi><mo>+</mo><mi>y</mi>") Renders: <math><mi>x</mi><mo>+</mo><mi>y</mi></math>
func RawTextf ¶
RawTextf Creates a new math element with formatted raw text content. Uses text.RawTextf which is not HTML-escaped. Example: math.RawTextf("<mi>%s</mi><mo>+</mo><mi>%s</mi>", a, b) Renders: <math><mi>x</mi><mo>+</mo><mi>y</mi></math>
func Static ¶
func Static(str string) *element
Static Creates a new math element with static text content. Uses text.Static which is not HTML-escaped and is JIT-optimisable. Example: math.Static("E = mc2") Renders: <math>E = mc2</math>