Documentation ¶
Index ¶
- Constants
- Variables
- func BuildAttributeHTML(key string, values []string, delimiter string, htmlEscape bool) string
- func HTMLToText(s string) string
- func HTMLToTextCondensed(s string) string
- func SimplifyHTMLText(s string) string
- func StreamlineCRLFs(s string) string
- func TextToHTML(s string) string
- func TextToHTMLBr2(s string) string
- type Element
- type Link
- type Text
Constants ¶
View Source
const ( TagDiv = "div" AttributeClass = "class" AttributeHref = "href" AttributeOnclick = "onclick" AttributeStyle = "style" DelimitSemicolon = ";" DelimitSpace = " " )
View Source
const ( Color2GreenHex = "#00FF2A" Color2YellowHex = "#DFDD13" Color2RedHex = "#FF0000" RingCentralOrangeHex = "#FF8800" RingCentralBlueHex = "#0073AE" RingCentralGreyHex = "#585858" )
Variables ¶
View Source
var ( ErrAttributeNameIsRequired = errors.New("attribute name is required") ErrTagNameIsRequired = errors.New("tag name is required") )
View Source
var ChartColor1 = [...]string{
"#3366CC",
"#DC3912",
"#FF9900",
"#109618",
"#990099",
"#3B3EAC",
"#0099C6",
"#DD4477",
"#66AA00",
"#B82E2E",
"#316395",
"#994499",
"#22AA99",
"#AAAA11",
"#6633CC",
"#E67300",
"#8B0707",
"#329262",
"#5574A6",
"#3B3EAC",
}
ChartColor1 is the color palette for Google Charts as collected by Craig Davis here: https://gist.github.com/there4/2579834
Functions ¶
func BuildAttributeHTML ¶ added in v0.40.12
func HTMLToText ¶ added in v0.37.0
HTMLToText converts HTML to multi-line text.
func HTMLToTextCondensed ¶ added in v0.37.0
HTMLToTextCondensed removes HTML tags, unescapes HTML entities, and removes extra whitespace including non-breaking spaces.
func SimplifyHTMLText ¶ added in v0.37.0
func StreamlineCRLFs ¶
func TextToHTML ¶ added in v0.37.0
func TextToHTMLBr2 ¶ added in v0.37.0
Types ¶
type Element ¶ added in v0.39.4
type Element struct { TagName string Attrs map[string][]string SelfClose bool InnerHTML []stringsutil.StringableWithErr }
func NewElement ¶ added in v0.39.4
func NewElement() *Element
func (*Element) AddAttribute ¶ added in v0.40.12
func (*Element) AddInnerHTML ¶ added in v0.40.13
func (el *Element) AddInnerHTML(innerHTML stringsutil.StringableWithErr)
func (*Element) AddInnerHTMLText ¶ added in v0.40.13
Click to show internal directories.
Click to hide internal directories.