Documentation ¶
Index ¶
Constants ¶
View Source
const (
DefaultLineLength = 65
)
Defaults
Variables ¶
View Source
var (
ErrBodyNotFound = errors.New("could not find a `body` element in your html document")
)
Well-defined errors
Functions ¶
func Convert ¶
Convert is a convenience method so the library can be used without initializing a converter because this library relies heavily on regexp objects, it may act as a bottlneck to concurrency due to thread-safety mutexes in *regexp.Regexp internals
func MustConvert ¶ added in v0.2.0
func WordWrap ¶
WordWrap searches for logical breakpoints in each line (whitespace) and tries to trim each line to the specified length Note: this diverges from the regex approach in premailer, which I found to be significantly slower in cases with long unbroken lines https://github.com/premailer/premailer/blob/7c94e7a/lib/premailer/html_to_plain_text.rb#L116
Types ¶
type Converter ¶
func NewRegexpConverter ¶ added in v0.2.0
func NewRegexpConverter() Converter
New textplain converter object
func NewTreeConverter ¶ added in v0.2.0
func NewTreeConverter() Converter
type RegexpConverter ¶ added in v0.2.0
type RegexpConverter struct {
// contains filtered or unexported fields
}
type TreeConverter ¶ added in v0.2.0
type TreeConverter struct{}
Click to show internal directories.
Click to hide internal directories.