util

package
v1.7.6 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: MulanPSL-2.0 Imports: 10 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToStr

func BytesToStr(bytes []byte) string

BytesToStr 快速转换 []byte 为 string。

func DomAttrValue added in v1.7.5

func DomAttrValue(n *html.Node, attrName string) string

func DomChildByType added in v1.7.6

func DomChildByType(n *html.Node, dataAtom atom.Atom) *html.Node

func DomCustomAttrs added in v1.7.6

func DomCustomAttrs(n *html.Node) (ret map[string]string)

func DomHTML added in v1.7.5

func DomHTML(n *html.Node) []byte

func DomText added in v1.7.5

func DomText(n *html.Node) string

func GetTextMarkAData added in v1.7.5

func GetTextMarkAData(n *html.Node) (href, title string)

func GetTextMarkBlockRefData added in v1.7.5

func GetTextMarkBlockRefData(n *html.Node) (id, subtype string)

func GetTextMarkFileAnnotationRefData added in v1.7.5

func GetTextMarkFileAnnotationRefData(n *html.Node) (id string)

func GetTextMarkInlineMathData added in v1.7.5

func GetTextMarkInlineMathData(n *html.Node) (content string)

func GetTextMarkInlineMemoData added in v1.7.5

func GetTextMarkInlineMemoData(n *html.Node) (content string)

func GetTextMarkTextData added in v1.7.5

func GetTextMarkTextData(n *html.Node) (content string)

func GetTextMarkTextDataWithoutEscapeSingleQuote added in v1.7.5

func GetTextMarkTextDataWithoutEscapeSingleQuote(n *html.Node) (content string)

func IsDocIAL

func IsDocIAL(tokens []byte) bool

func IsDocIAL2

func IsDocIAL2(ial [][]string) bool

func IsTempMarkSpan added in v1.7.6

func IsTempMarkSpan(n *html.Node) bool

func PathEscape

func PathEscape(s string) string

PathEscape escapes the string so it can be safely placed inside a URL path segment.

func PathUnescape

func PathUnescape(s string) (string, error)

PathUnescape does the inverse transformation of PathEscape, converting each 3-byte encoded substring of the form "%AB" into the hex-decoded byte 0xAB. It returns an error if any % is not followed by two hexadecimal digits.

PathUnescape is identical to QueryUnescape except that it does not unescape '+' to ' ' (space).

func RecoverPanic

func RecoverPanic(err *error)

RecoverPanic recovers a panic.

func StrToBytes

func StrToBytes(str string) []byte

StrToBytes 快速转换 string 为 []byte。

func WordCount

func WordCount(str string) (runeCount, wordCount int)

Types

type EscapeError

type EscapeError string

func (EscapeError) Error

func (e EscapeError) Error() string

type InvalidHostError

type InvalidHostError string

func (InvalidHostError) Error

func (e InvalidHostError) Error() string

Jump to

Keyboard shortcuts

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