Documentation
¶
Index ¶
- func EscapeHTML(content string) string
- func FormatWithLineBreaks(content string) string
- type HTMLBuilder
- func (b *HTMLBuilder) Build() string
- func (b *HTMLBuilder) EndElement(tag string)
- func (b *HTMLBuilder) EndSpan()
- func (b *HTMLBuilder) Len() int
- func (b *HTMLBuilder) Raw(htmlContent string)
- func (b *HTMLBuilder) Reset()
- func (b *HTMLBuilder) StartElement(tag string, attrs map[string]string)
- func (b *HTMLBuilder) StartSpan(classes []string, styles map[string]string)
- func (b *HTMLBuilder) Text(content string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EscapeHTML ¶
EscapeHTML is a utility function to escape HTML content
func FormatWithLineBreaks ¶
FormatWithLineBreaks converts newlines to HTML line breaks
Types ¶
type HTMLBuilder ¶
type HTMLBuilder struct {
// contains filtered or unexported fields
}
HTMLBuilder constructs HTML content incrementally.
func (*HTMLBuilder) Build ¶
func (b *HTMLBuilder) Build() string
Build returns the built HTML string
func (*HTMLBuilder) EndElement ¶
func (b *HTMLBuilder) EndElement(tag string)
EndElement ends the current HTML element
func (*HTMLBuilder) Len ¶
func (b *HTMLBuilder) Len() int
Len returns the current number of parts in the builder
func (*HTMLBuilder) Raw ¶
func (b *HTMLBuilder) Raw(htmlContent string)
Raw adds raw HTML content (use with caution)
func (*HTMLBuilder) StartElement ¶
func (b *HTMLBuilder) StartElement(tag string, attrs map[string]string)
StartElement starts a new HTML element with optional attributes
func (*HTMLBuilder) StartSpan ¶
func (b *HTMLBuilder) StartSpan(classes []string, styles map[string]string)
StartSpan starts a new span element with optional classes and styles
func (*HTMLBuilder) Text ¶
func (b *HTMLBuilder) Text(content string)
Text adds escaped text content
Click to show internal directories.
Click to hide internal directories.