Documentation ¶
Overview ¶
Package bbConvert provides an easy way to process and convert bbCode. HTMLConverter is an easier way to convert to HTML.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Converter ¶
type Converter struct {
// contains filtered or unexported fields
}
Converter provides an easy way to convert bbCode.
type HTMLConverter ¶
type HTMLConverter struct {
// contains filtered or unexported fields
}
HTMLConverter is an easy way to convert bbCode to HTML. It automatically wraps the output in paragraph tags and properly converts newlines (\n) to paragraphs.
func (*HTMLConverter) AddClass ¶
func (h *HTMLConverter) AddClass(class string)
AddClass adds a class to the paragraph tags used to wrap the output. Multiple classes can be added at once if they are separated by spaces.
func (*HTMLConverter) Convert ¶
func (h *HTMLConverter) Convert(in string) string
Convert converts the input with bbCode to output with HTML
func (*HTMLConverter) Converter ¶
func (h *HTMLConverter) Converter() *Converter
Converter returns the Converter that's used in the HTMLConverter so you can add custom functions and other items that you can access with the Converter
func (*HTMLConverter) ImplementDefaults ¶
func (h *HTMLConverter) ImplementDefaults()
ImplementDefaults adds the default supported bbCode to HTML conversions.
func (*HTMLConverter) SetStyle ¶
func (h *HTMLConverter) SetStyle(css, value string)
SetStyle sets a give style to the paragraph tags used to wrap the output.
func (*HTMLConverter) StartingParagraphTag ¶
func (h *HTMLConverter) StartingParagraphTag() string
StartingParagraphTag returns the starting paragraph tags used when wraping the output in paragraph tags with the proper style and class(es)