truncatehtml

package
v0.0.0-...-125d915 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2015 License: MIT Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EntityExpr = regexp.MustCompile("&#?[A-Za-z0-9]+;")
View Source
var TagExpr = regexp.MustCompile("<(/?)([A-Za-z0-9]+).*?>")
View Source
var UnbalancedTagsError = errors.New("unbalanced tags")

Functions

func TruncateHtml

func TruncateHtml(buf []byte, maxlen int, ellipsis string) ([]byte, error)

TruncateHtml will truncate a given byte slice to a maximum of maxlen visible characters and optionally append ellipsis. HTML tags are automatically closed generating valid truncated HTML.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL