Skip to content

Instantly share code, notes, and snippets.

@Adron
Created July 3, 2019 03:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Adron/a82f44803107b169f5916d212077de87 to your computer and use it in GitHub Desktop.
Save Adron/a82f44803107b169f5916d212077de87 to your computer and use it in GitHub Desktop.
The types, nodes, constants, etc setup for parsing HTML.
type NodeType int32
const (
ErrorNode NodeType = iota
TextNode
DocumentNode
ElementNode
Commentnode
DoctypeNode
)
type Node struct {
Type NodeType
Data string
Attr []Attribute
FirstChild, NextSibling *Node
}
type Attribute struct {
Key, Val string
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment