Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BBConverter ¶ added in v1.0.2
type BBConverter struct {
// contains filtered or unexported fields
}
A converter for BBCode
func NewBBConverter ¶ added in v1.0.2
func NewBBConverter() BBConverter
func (BBConverter) CustomConvert ¶ added in v1.0.2
func (b BBConverter) CustomConvert(bb string, convert map[string]BBConvert) string
Parse and Convert BBCode. The BBCode is replaced with the return from the given conversion function. The key in the map is the BBCode's tag
func (BBConverter) HTMLConvert ¶ added in v1.0.2
func (b BBConverter) HTMLConvert(bb string) string
Converts BBCode into HTML.
type BBTag ¶ added in v1.0.2
type BBTag struct { Tag string // Leading value (if it exists). Eg. [img=500x200] Leading string // If the parameter doesn't have an associated value then it'll be set to an empty string // Eg. [float right] = {"right": ""} // Eg. [font color=red] = {"color": "red"} Values map[string]string // The string in between the tags Middle string }
type ComboConverter ¶ added in v1.0.2
type ComboConverter struct {
// contains filtered or unexported fields
}
A BBCode and Markdown converter all in one. Attemps to prevent some potential errors when doing them separately.
func NewComboConverter ¶ added in v1.0.2
func NewComboConverter() ComboConverter
func (ComboConverter) BBHTMLConvert ¶ added in v1.0.2
func (c ComboConverter) BBHTMLConvert(in string) string
Converts just BBCode to HTML
func (ComboConverter) HTMLConvert ¶ added in v1.0.2
func (c ComboConverter) HTMLConvert(combo string) string
Convert BBCode and Markdown to HTML
func (ComboConverter) MarkdownHTMLConvert ¶ added in v1.0.2
func (c ComboConverter) MarkdownHTMLConvert(in string) string
Converts just Markdown to HTML
type MarkdownConverter ¶ added in v1.0.2
type MarkdownConverter struct {
// contains filtered or unexported fields
}
func NewMarkdownConverter ¶ added in v1.0.2
func NewMarkdownConverter() MarkdownConverter
func (MarkdownConverter) HTMLConvert ¶ added in v1.0.2
func (m MarkdownConverter) HTMLConvert(mk string) string
Click to show internal directories.
Click to hide internal directories.