adoc/element/element.go

32 lines
441 B
Go
Raw Permalink Normal View History

2022-03-15 15:16:15 +01:00
package element
2024-09-15 12:07:22 +02:00
import "go-mod.ewintr.nl/adoc/token"
2022-03-15 15:16:15 +01:00
type Element interface {
Text() string
Append([]Element) Element
}
type ParseResult struct {
Element Element
Inner []token.Token
}
type ReadUnreader interface {
Read(n int) ([]token.Token, bool)
Unread(n int) bool
}
type Empty struct{}
func (e Empty) Text() string { return "" }
type Image struct {
Src string
Alt string
}
func (i Image) Text() string {
return i.Alt
}