html

package
v0.0.0-...-8504736 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attr

type Attr struct {
	Name  string
	Value string
}

type TagOrText

type TagOrText struct {
	TagName  string
	Text     string
	Attr     []*Attr
	Children []*TagOrText
}

func ParseHtml

func ParseHtml(r *bytes.Reader) (tag *TagOrText, htmlSrc []byte, err error)

ParseHtml Reads and parses the html from the starting tag to the matching end tag. If the tag depth is inconsistent or the tags at the same depth are not the same type then an error is returned.

After the html is parsed r is reset to the remaining bytes that have not been parsed.

func ParseHtmlString

func ParseHtmlString(htmlRaw string) (*TagOrText, error)

func (*TagOrText) AppendChild

func (t *TagOrText) AppendChild(child *TagOrText)

func (*TagOrText) DebugString

func (t *TagOrText) DebugString() string

func (*TagOrText) IsGoCodeEmbed

func (t *TagOrText) IsGoCodeEmbed() bool

Jump to

Keyboard shortcuts

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