html

package
v0.0.0-...-c13b88d Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2022 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EscapeAttribute

func EscapeAttribute(s string) string

func EscapeCharData

func EscapeCharData(s string) string

func EscapeString

func EscapeString(s string) string

func NormalizeURL

func NormalizeURL(s string) string

NormalizeURL normalizes url to be safely included as an href based on golang.org/pkg/html/template

func XMLStripTags

func XMLStripTags(xmlcontent string) (string, error)

func XMLText

func XMLText(decoder *xml.Decoder) (string, error)

Types

type Encoder

type Encoder struct {
	RewriteID string
	// contains filtered or unexported fields
}

func NewEncoder

func NewEncoder(out io.Writer) *Encoder

func (*Encoder) Depth

func (enc *Encoder) Depth() int

func (*Encoder) Encode

func (enc *Encoder) Encode(token xml.Token) error

func (*Encoder) Flush

func (enc *Encoder) Flush() error

func (*Encoder) Stack

func (enc *Encoder) Stack() []string

func (*Encoder) WriteEnd

func (enc *Encoder) WriteEnd(tag string) error

func (*Encoder) WriteRaw

func (enc *Encoder) WriteRaw(data string) error

func (*Encoder) WriteStart

func (enc *Encoder) WriteStart(tag string, attrs ...xml.Attr) error

func (*Encoder) WriteXMLEnd

func (enc *Encoder) WriteXMLEnd(token *xml.EndElement) error

func (*Encoder) WriteXMLStart

func (enc *Encoder) WriteXMLStart(token *xml.StartElement) error

Jump to

Keyboard shortcuts

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