Versions in this module Expand all Collapse all v0 v0.28.1 Aug 29, 2024 Changes in this version + var ErrBufferExceeded = errors.New("max buffer exceeded") + func EscapeString(s string) string + func Render(w io.Writer, n *Node) error + func UnescapeString(s string) string + type Attribute struct + Key string + Namespace string + Val string + type Node struct + Attr []Attribute + Data string + DataAtom atom.Atom + FirstChild *Node + LastChild *Node + Namespace string + NextSibling *Node + Parent *Node + PrevSibling *Node + Type NodeType + func Parse(r io.Reader) (*Node, error) + func ParseFragment(r io.Reader, context *Node) ([]*Node, error) + func ParseFragmentWithOptions(r io.Reader, context *Node, opts ...ParseOption) ([]*Node, error) + func ParseWithOptions(r io.Reader, opts ...ParseOption) (*Node, error) + func (n *Node) AppendChild(c *Node) + func (n *Node) InsertBefore(newChild, oldChild *Node) + func (n *Node) RemoveChild(c *Node) + type NodeType uint32 + const CommentNode + const DoctypeNode + const DocumentNode + const ElementNode + const ErrorNode + const RawNode + const TextNode + type ParseOption func(p *parser) + func ParseOptionEnableScripting(enable bool) ParseOption + type Token struct + Attr []Attribute + Data string + DataAtom atom.Atom + Type TokenType + func (t Token) String() string + type TokenType uint32 + const CommentToken + const DoctypeToken + const EndTagToken + const ErrorToken + const SelfClosingTagToken + const StartTagToken + const TextToken + func (t TokenType) String() string + type Tokenizer struct + func NewTokenizer(r io.Reader) *Tokenizer + func NewTokenizerFragment(r io.Reader, contextTag string) *Tokenizer + func (z *Tokenizer) AllowCDATA(allowCDATA bool) + func (z *Tokenizer) Buffered() []byte + func (z *Tokenizer) Err() error + func (z *Tokenizer) Next() TokenType + func (z *Tokenizer) NextIsNotRawText() + func (z *Tokenizer) Raw() []byte + func (z *Tokenizer) SetMaxBuf(n int) + func (z *Tokenizer) TagAttr() (key, val []byte, moreAttr bool) + func (z *Tokenizer) TagName() (name []byte, hasAttr bool) + func (z *Tokenizer) Text() []byte + func (z *Tokenizer) Token() Token