func NewRawTextSegment(v textm.Segment) *Text {
	t := &Text{
		BaseInline: BaseInline{},
		Segment:    v,
	}
	t.SetRaw(true)
	return t
}
NewRawTextSegment returns a new Text node with the given source position.
The new node should be rendered as raw contents.
package ast
import (
	"fmt"
	"strings"
	textm "github.com/yuin/goldmark/text"
	"github.com/yuin/goldmark/util"
)
type BaseInline struct {
	BaseNode
}
func (b *BaseInline) Type() NodeType {
	return TypeInline
}
func (b *BaseInline) IsRaw() bool {
	return false
}
func (b *BaseInline) HasBlankPreviousLines() bool {
	panic("can not call with inline nodes.")
}
func (b *BaseInline) SetBlankPreviousLines(v bool) {
	panic("can not call with inline nodes.")
}
func (b *BaseInline) Lines() *textm.Segments {
	panic("can not call with inline nodes.")
}
func (b *BaseInline) SetLines(v *textm.Segments) {
	panic("can not call with inline nodes.")
}
type Text struct {
	BaseInline
	Segment textm.Segment
	flags uint8
}
const (
	textSoftLineBreak = 1 << iota
	textHardLineBreak
	textRaw
	textCode
)
func textFlagsString(flags uint8) string {
	buf := []string{}
	if flags&textSoftLineBreak != 0 {
		buf = append(buf, "SoftLineBreak")
	}
	if flags&textHardLineBreak != 0 {
		buf = append(buf, "HardLineBreak")
	}
	if flags&textRaw != 0 {
		buf = append(buf, "Raw")
	}
	if flags&textCode != 0 {
		buf = append(buf, "Code")
	}
	return strings.Join(buf, ", ")
}
func (n *Text) Inline() {
}
func (n *Text) SoftLineBreak() bool {
	return n.flags&textSoftLineBreak != 0
}
func (n *Text) SetSoftLineBreak(v bool) {
	if v {
		n.flags |= textSoftLineBreak
	} else {
		n.flags = n.flags &^ textHardLineBreak
	}
}
func (n *Text) IsRaw() bool {
	return n.flags&textRaw != 0
}
func (n *Text) SetRaw(v bool) {
	if v {
		n.flags |= textRaw
	} else {
		n.flags = n.flags &^ textRaw
	}
}
func (n *Text) HardLineBreak() bool {
	return n.flags&textHardLineBreak != 0
}
func (n *Text) SetHardLineBreak(v bool) {
	if v {
		n.flags |= textHardLineBreak
	} else {
		n.flags = n.flags &^ textHardLineBreak
	}
}
func (n *Text) Merge(node Node, source []byte) bool {
	t, ok := node.(*Text)
	if !ok {
		return false
	}
	if n.Segment.Stop != t.Segment.Start || t.Segment.Padding != 0 || source[n.Segment.Stop-1] == '\n' || t.IsRaw() != n.IsRaw() {
		return false
	}
	n.Segment.Stop = t.Segment.Stop
	n.SetSoftLineBreak(t.SoftLineBreak())
	n.SetHardLineBreak(t.HardLineBreak())
	return true
}
func (n *Text) Text(source []byte) []byte {
	return n.Segment.Value(source)
}
func (n *Text) Dump(source []byte, level int) {
	fs := textFlagsString(n.flags)
	if len(fs) != 0 {
		fs = "(" + fs + ")"
	}
	fmt.Printf("%sText%s: \"%s\"\n", strings.Repeat("    ", level), fs, strings.TrimRight(string(n.Text(source)), "\n"))
}
var KindText = NewNodeKind("Text")
func (n *Text) Kind() NodeKind {
	return KindText
}
func NewText() *Text {
	return &Text{
		BaseInline: BaseInline{},
	}
}
func NewTextSegment(v textm.Segment) *Text {
	return &Text{
		BaseInline: BaseInline{},
		Segment:    v,
	}
}