func (n *BaseNode) PreviousSibling() Node {
	return n.prev
}
PreviousSibling implements Node.PreviousSibling .
package ast
import (
	"bytes"
	"fmt"
	"strings"
	textm "github.com/yuin/goldmark/text"
	"github.com/yuin/goldmark/util"
)
type NodeType int
const (
	TypeBlock NodeType = iota + 1
	TypeInline
	TypeDocument
)
type NodeKind int
func (k NodeKind) String() string {
	return kindNames[k]
}
var kindMax NodeKind
var kindNames = []string{""}
func NewNodeKind(name string) NodeKind {
	kindMax++
	kindNames = append(kindNames, name)
	return kindMax
}
type Attribute struct {
	Name  []byte
	Value interface{}
}
type Node interface {
	Type() NodeType
	Kind() NodeKind
	NextSibling() Node
	PreviousSibling() Node
	Parent() Node
	SetParent(Node)
	SetPreviousSibling(Node)
	SetNextSibling(Node)
	HasChildren() bool
	ChildCount() int
	FirstChild() Node
	LastChild() Node
	AppendChild(self, child Node)
	RemoveChild(self, child Node)
	RemoveChildren(self Node)
	SortChildren(comparator func(n1, n2 Node) int)
	ReplaceChild(self, v1, insertee Node)
	InsertBefore(self, v1, insertee Node)
	InsertAfter(self, v1, insertee Node)
	OwnerDocument() *Document
	Dump(source []byte, level int)
	Text(source []byte) []byte
	HasBlankPreviousLines() bool
	SetBlankPreviousLines(v bool)
	Lines() *textm.Segments
	SetLines(*textm.Segments)
	IsRaw() bool
	SetAttribute(name []byte, value interface{})
	SetAttributeString(name string, value interface{})
	Attribute(name []byte) (interface{}, bool)
	AttributeString(name string) (interface{}, bool)
	Attributes() []Attribute
	RemoveAttributes()
}
type BaseNode struct {
	firstChild Node
	lastChild  Node
	parent     Node
	next       Node
	prev       Node
	childCount int
	attributes []Attribute
}
func ensureIsolated(v Node) {
	if p := v.Parent(); p != nil {
		p.RemoveChild(p, v)
	}
}
func (n *BaseNode) HasChildren() bool {
	return n.firstChild != nil
}
func (n *BaseNode) SetPreviousSibling(v Node) {
	n.prev = v
}
func (n *BaseNode) SetNextSibling(v Node) {
	n.next = v
}